@@ -428,7 +428,7 @@ describe('ngMock', function() {
428
428
429
429
it ( 'should delegate exception to the $exceptionHandler service' , inject (
430
430
function ( $interval , $exceptionHandler ) {
431
- $interval ( function ( ) { throw " Test Error" ; } , 1000 ) ;
431
+ $interval ( function ( ) { throw new Error ( ' Test Error' ) ; } , 1000 ) ;
432
432
expect ( $exceptionHandler . errors ) . toEqual ( [ ] ) ;
433
433
434
434
$interval . flush ( 1000 ) ;
@@ -443,7 +443,7 @@ describe('ngMock', function() {
443
443
function ( $interval , $rootScope ) {
444
444
var applySpy = spyOn ( $rootScope , '$apply' ) . and . callThrough ( ) ;
445
445
446
- $interval ( function ( ) { throw " Test Error" ; } , 1000 ) ;
446
+ $interval ( function ( ) { throw new Error ( ' Test Error' ) ; } , 1000 ) ;
447
447
expect ( applySpy ) . not . toHaveBeenCalled ( ) ;
448
448
449
449
$interval . flush ( 1000 ) ;
@@ -454,7 +454,7 @@ describe('ngMock', function() {
454
454
it ( 'should still update the interval promise when an exception is thrown' ,
455
455
inject ( function ( $interval ) {
456
456
var log = [ ] ,
457
- promise = $interval ( function ( ) { throw " Some Error" ; } , 1000 ) ;
457
+ promise = $interval ( function ( ) { throw new Error ( ' Some Error' ) ; } , 1000 ) ;
458
458
459
459
promise . then ( function ( value ) { log . push ( 'promise success: ' + value ) ; } ,
460
460
function ( err ) { log . push ( 'promise error: ' + err ) ; } ,
@@ -934,7 +934,7 @@ describe('ngMock', function() {
934
934
it ( 'should not change thrown strings' , inject ( function ( $sniffer ) {
935
935
expect ( function ( ) {
936
936
inject ( function ( ) {
937
- throw 'test message' ;
937
+ throw new Error ( 'test message' ) ;
938
938
} ) ;
939
939
} ) . toThrow ( 'test message' ) ;
940
940
} ) ) ;
@@ -948,7 +948,7 @@ describe('ngMock', function() {
948
948
if ( ! error . stack ) {
949
949
try {
950
950
throw error ;
951
- } catch ( e ) { }
951
+ } catch ( e ) { /** do nothing **/ }
952
952
}
953
953
954
954
return ! ! error . stack ;
@@ -1742,23 +1742,23 @@ describe('ngMock', function() {
1742
1742
angular . forEach ( [ 'expectRoute' , 'whenRoute' ] , function ( routeShortcut ) {
1743
1743
var methods = [ 'GET' , 'POST' , 'PUT' , 'PATCH' , 'DELETE' , 'JSONP' ] ;
1744
1744
they ( 'should provide ' + routeShortcut + ' shortcut with $prop method' , methods ,
1745
- function ( ) {
1745
+ /** @this **/ function ( ) {
1746
1746
hb [ routeShortcut ] ( this , '/route' ) . respond ( 'path' ) ;
1747
1747
hb ( this , '/route' , undefined , callback ) ;
1748
1748
hb . flush ( ) ;
1749
1749
expect ( callback ) . toHaveBeenCalledOnceWith ( 200 , 'path' , '' , '' ) ;
1750
1750
}
1751
1751
) ;
1752
1752
they ( 'should match colon deliminated parameters in ' + routeShortcut + ' $prop method' , methods ,
1753
- function ( ) {
1753
+ /** @this **/ function ( ) {
1754
1754
hb [ routeShortcut ] ( this , '/route/:id/path/:s_id' ) . respond ( 'path' ) ;
1755
1755
hb ( this , '/route/123/path/456' , undefined , callback ) ;
1756
1756
hb . flush ( ) ;
1757
1757
expect ( callback ) . toHaveBeenCalledOnceWith ( 200 , 'path' , '' , '' ) ;
1758
1758
}
1759
1759
) ;
1760
1760
they ( 'should ignore query param when matching in ' + routeShortcut + ' $prop method' , methods ,
1761
- function ( ) {
1761
+ /** @this **/ function ( ) {
1762
1762
hb [ routeShortcut ] ( this , '/route/:id' ) . respond ( 'path' ) ;
1763
1763
hb ( this , '/route/123?q=str&foo=bar' , undefined , callback ) ;
1764
1764
hb . flush ( ) ;
@@ -2031,7 +2031,7 @@ describe('ngMock', function() {
2031
2031
{ name : 'flurp' , id : 2 }
2032
2032
] ;
2033
2033
module ( function ( $controllerProvider ) {
2034
- $controllerProvider . register ( 'testCtrl' , function ( ) {
2034
+ $controllerProvider . register ( 'testCtrl' , /** @this **/ function ( ) {
2035
2035
called = true ;
2036
2036
expect ( this . data ) . toBe ( data ) ;
2037
2037
} ) ;
@@ -2051,7 +2051,7 @@ describe('ngMock', function() {
2051
2051
{ name : 'flurp' , id : 2 }
2052
2052
] ;
2053
2053
module ( function ( $controllerProvider ) {
2054
- $controllerProvider . register ( 'testCtrl' , function ( ) {
2054
+ $controllerProvider . register ( 'testCtrl' , /** @this **/ function ( ) {
2055
2055
called = true ;
2056
2056
expect ( this . data ) . toBe ( data ) ;
2057
2057
@@ -2961,7 +2961,7 @@ describe('sharedInjector', function() {
2961
2961
2962
2962
// run a set of test cases in the sdescribe stub test framework
2963
2963
function ngMockTest ( define ) {
2964
- return function ( ) {
2964
+ return /** @this **/ function ( ) {
2965
2965
var spec = this ;
2966
2966
module . $$currentSpec ( null ) ;
2967
2967
0 commit comments