@@ -4956,16 +4956,15 @@ describe('$compile', function() {
49564956 $rootScope . $apply ( 'a = 42' ) ;
49574957
49584958 // The first component's error should be logged
4959- var errors = $exceptionHandler . errors . pop ( ) ;
4960- expect ( errors [ 0 ] ) . toEqual ( new Error ( 'bad hook' ) ) ;
4959+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook' ) ) ;
49614960
49624961 // The second component's changes should still be called
49634962 expect ( $log . info . logs . pop ( ) ) . toEqual ( [ 'onChange' ] ) ;
49644963 } ) ;
49654964 } ) ;
49664965
49674966
4968- it ( 'should collect up all `$onChanges` errors into one throw ' , function ( ) {
4967+ it ( 'should throw `$onChanges` errors immediately ' , function ( ) {
49694968 function ThrowingController ( ) {
49704969 this . $onChanges = function ( change ) {
49714970 throw new Error ( 'bad hook: ' + this . prop ) ;
@@ -4994,10 +4993,9 @@ describe('$compile', function() {
49944993
49954994 $rootScope . $apply ( 'a = 42' ) ;
49964995
4997- // Both component's error should be logged
4998- var errors = $exceptionHandler . errors . pop ( ) ;
4999- expect ( errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 84' ) ) ;
5000- expect ( errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 42' ) ) ;
4996+ // Both component's error should be logged individually
4997+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 84' ) ) ;
4998+ expect ( $exceptionHandler . errors . pop ( ) ) . toEqual ( new Error ( 'bad hook: 42' ) ) ;
50014999 } ) ;
50025000 } ) ;
50035001 } ) ;
0 commit comments