refactor(NgZone): idiomatic Dart

This commit is contained in:
Victor Berchet 2015-07-13 23:26:27 +02:00
parent 5677bf73ca
commit 7dc1dff816

View File

@ -73,7 +73,7 @@ class NgZone {
* It is called once per browser event. * It is called once per browser event.
*/ */
void overrideOnTurnStart(ZeroArgFunction onTurnStartFn) { void overrideOnTurnStart(ZeroArgFunction onTurnStartFn) {
this._onTurnStart = onTurnStartFn; _onTurnStart = onTurnStartFn;
} }
/** /**
@ -81,7 +81,7 @@ class NgZone {
* all pending microtasks. * all pending microtasks.
*/ */
void overrideOnTurnDone(ZeroArgFunction onTurnDoneFn) { void overrideOnTurnDone(ZeroArgFunction onTurnDoneFn) {
this._onTurnDone = onTurnDoneFn; _onTurnDone = onTurnDoneFn;
} }
/** /**
@ -93,7 +93,7 @@ class NgZone {
* This hook is useful for validating application state (e.g. in a test). * This hook is useful for validating application state (e.g. in a test).
*/ */
void overrideOnEventDone(ZeroArgFunction onEventDoneFn) { void overrideOnEventDone(ZeroArgFunction onEventDoneFn) {
this._onEventDone = onEventDoneFn; _onEventDone = onEventDoneFn;
} }
/** /**
@ -102,7 +102,7 @@ class NgZone {
* the stack trace. * the stack trace.
*/ */
void overrideOnErrorHandler(ErrorHandlingFn errorHandlingFn) { void overrideOnErrorHandler(ErrorHandlingFn errorHandlingFn) {
this._onErrorHandler = errorHandlingFn; _onErrorHandler = errorHandlingFn;
} }
/** /**
@ -173,7 +173,7 @@ class NgZone {
// Trigger onTurnDone at the end of a turn if _innerZone has executed some code // Trigger onTurnDone at the end of a turn if _innerZone has executed some code
try { try {
_inVmTurnDone = true; _inVmTurnDone = true;
parent.run(_innerZone, _onTurnDone); parent.run(_innerZone, _onTurnDone);
if (_pendingMicrotasks == 0 && _onEventDone != null) { if (_pendingMicrotasks == 0 && _onEventDone != null) {
runOutsideAngular(_onEventDone); runOutsideAngular(_onEventDone);