fix(Scope): don't clear the phase when an exception is thrown from asyncQueue or watch

If we clear it here, then any other watch or async task could start a new digest.
This commit is contained in:
Igor Minar
2014-08-11 08:50:08 -07:00
parent ece6ef479c
commit bf1a57ad48
2 changed files with 0 additions and 11 deletions

View File

@@ -699,7 +699,6 @@ function $RootScopeProvider(){
asyncTask = asyncQueue.shift();
asyncTask.scope.$eval(asyncTask.expression);
} catch (e) {
clearPhase();
$exceptionHandler(e);
}
lastDirtyWatch = null;
@@ -742,7 +741,6 @@ function $RootScopeProvider(){
}
}
} catch (e) {
clearPhase();
$exceptionHandler(e);
}
}

View File

@@ -176,15 +176,6 @@ describe('Scope', function() {
});
});
it('should clear phase if an exception interrupt $digest cycle', function() {
inject(function($rootScope) {
$rootScope.$watch('a', function() {throw new Error('abc');});
$rootScope.a = 1;
try { $rootScope.$digest(); } catch(e) { }
expect($rootScope.$$phase).toBeNull();
});
});
it('should fire watches in order of addition', inject(function($rootScope) {
// this is not an external guarantee, just our own sanity