Skip to content

Commit caad0ad

Browse files
fix($compile): cope with $onChanges hooks throwing
Previously, if one of these hooks threw an error, then any other `$onChanges` hooks that had been scheduled were not executed, nor was the queue cleaned up properly. Closes angular#14444 Closes angular#14463
1 parent c57ed91 commit caad0ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/ng/compileSpec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4115,7 +4115,8 @@ describe('$compile', function() {
41154115
$rootScope.$apply('a = 42');
41164116

41174117
// The first component's error should be logged
4118-
expect($exceptionHandler.errors.pop()).toEqual([new Error('bad hook')]);
4118+
var errors = $exceptionHandler.errors.pop();
4119+
expect(errors[0]).toEqual(new Error('bad hook'));
41194120

41204121
// The second component's changes should still be called
41214122
expect($log.info.logs.pop()).toEqual(['onChange']);

0 commit comments

Comments
 (0)