@@ -5075,16 +5075,15 @@ describe('$compile', function() {
5075
5075
$rootScope . $apply ( 'a = 42' ) ;
5076
5076
5077
5077
// The first component's error should be logged
5078
- var errors = $exceptionHandler . errors . pop ( ) ;
5079
- expect ( errors [ 0 ] ) . toEqual ( new Error ( 'bad hook' ) ) ;
5078
+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook' ) ) ;
5080
5079
5081
5080
// The second component's changes should still be called
5082
5081
expect ( $log . info . logs . pop ( ) ) . toEqual ( [ 'onChange' ] ) ;
5083
5082
} ) ;
5084
5083
} ) ;
5085
5084
5086
5085
5087
- it ( 'should collect up all `$onChanges` errors into one throw ' , function ( ) {
5086
+ it ( 'should throw `$onChanges` errors immediately ' , function ( ) {
5088
5087
function ThrowingController ( ) {
5089
5088
this . $onChanges = function ( change ) {
5090
5089
throw new Error ( 'bad hook: ' + this . prop ) ;
@@ -5113,10 +5112,9 @@ describe('$compile', function() {
5113
5112
5114
5113
$rootScope . $apply ( 'a = 42' ) ;
5115
5114
5116
- // Both component's error should be logged
5117
- var errors = $exceptionHandler . errors . pop ( ) ;
5118
- expect ( errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 84' ) ) ;
5119
- expect ( errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 42' ) ) ;
5115
+ // Both component's error should be logged individually
5116
+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 84' ) ) ;
5117
+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 42' ) ) ;
5120
5118
} ) ;
5121
5119
} ) ;
5122
5120
} ) ;
0 commit comments