@@ -118,7 +118,7 @@ describe('angular', function() {
118118
119119 it ( 'should throw an exception when source and destination are equivalent' , function ( ) {
120120 var src , dst ;
121- src = dst = { key : 'value' } ;
121+ src = dst = { key : 'value' } ;
122122 expect ( function ( ) { copy ( src , dst ) ; } ) . toThrowMinErr ( "ng" , "cpi" , "Can't copy! Source and destination are identical." ) ;
123123 src = dst = [ 2 , 4 ] ;
124124 expect ( function ( ) { copy ( src , dst ) ; } ) . toThrowMinErr ( "ng" , "cpi" , "Can't copy! Source and destination are identical." ) ;
@@ -149,7 +149,6 @@ describe('angular', function() {
149149 } ) ;
150150
151151 describe ( "extend" , function ( ) {
152-
153152 it ( 'should not copy the private $$hashKey' , function ( ) {
154153 var src , dst ;
155154 src = { } ;
@@ -209,7 +208,7 @@ describe('angular', function() {
209208
210209 it ( 'should omit properties from prototype chain' , function ( ) {
211210 var original , clone = { } ;
212- function Func ( ) { } ;
211+ function Func ( ) { }
213212 Func . prototype . hello = "world" ;
214213
215214 original = new Func ( ) ;
@@ -316,6 +315,7 @@ describe('angular', function() {
316315 } ) ;
317316
318317 it ( 'should correctly test for keys that are present on Object.prototype' , function ( ) {
318+ /* jshint -W001 */
319319 // MS IE8 just doesn't work for this kind of thing, since "for ... in" doesn't return
320320 // things like hasOwnProperty even if it is explicitly defined on the actual object!
321321 if ( msie <= 8 ) return ;
@@ -457,7 +457,7 @@ describe('angular', function() {
457457 expect ( toKeyValue ( { key : [ 323 , 'value' , true ] } ) ) . toEqual ( 'key=323&key=value&key' ) ;
458458 expect ( toKeyValue ( { key : [ 323 , 'value' , true , 1234 ] } ) ) .
459459 toEqual ( 'key=323&key=value&key&key=1234' ) ;
460- } ) ;
460+ } ) ;
461461 } ) ;
462462
463463
@@ -472,13 +472,14 @@ describe('angular', function() {
472472 var obj = new MyObj ( ) ,
473473 log = [ ] ;
474474
475- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
475+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
476476
477477 expect ( log ) . toEqual ( [ 'bar:barVal' , 'baz:bazVal' ] ) ;
478478 } ) ;
479479
480480
481481 it ( 'should not break if obj is an array we override hasOwnProperty' , function ( ) {
482+ /* jshint -W001 */
482483 var obj = [ ] ;
483484 obj [ 0 ] = 1 ;
484485 obj [ 1 ] = 2 ;
@@ -506,7 +507,7 @@ describe('angular', function() {
506507 log = [ ] ;
507508
508509
509- forEach ( nodeList , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
510+ forEach ( nodeList , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
510511 expect ( log ) . toEqual ( [ '0:a' , '1:b' , '2:c' ] ) ;
511512 } ) ;
512513
@@ -521,7 +522,7 @@ describe('angular', function() {
521522 var htmlCollection = document . getElementsByName ( 'x' ) ,
522523 log = [ ] ;
523524
524- forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
525+ forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
525526 expect ( log ) . toEqual ( [ '0:a' , '1:c' ] ) ;
526527 } ) ;
527528
@@ -536,7 +537,7 @@ describe('angular', function() {
536537 var htmlCollection = document . querySelectorAll ( '[name="x"]' ) ,
537538 log = [ ] ;
538539
539- forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
540+ forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
540541 expect ( log ) . toEqual ( [ '0:a' , '1:c' ] ) ;
541542 } ) ;
542543 }
@@ -545,42 +546,42 @@ describe('angular', function() {
545546 var args ,
546547 log = [ ] ;
547548
548- ( function ( ) { args = arguments } ( 'a' , 'b' , 'c' ) ) ;
549+ ( function ( ) { args = arguments ; } ( 'a' , 'b' , 'c' ) ) ;
549550
550- forEach ( args , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
551+ forEach ( args , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
551552 expect ( log ) . toEqual ( [ '0:a' , '1:b' , '2:c' ] ) ;
552553 } ) ;
553554
554555 it ( 'should handle string values like arrays' , function ( ) {
555556 var log = [ ] ;
556557
557- forEach ( 'bar' , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
558+ forEach ( 'bar' , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
558559 expect ( log ) . toEqual ( [ '0:b' , '1:a' , '2:r' ] ) ;
559560 } ) ;
560561
561562
562563 it ( 'should handle objects with length property as objects' , function ( ) {
563564 var obj = {
564- 'foo' : 'bar' ,
565- 'length' : 2
566- } ,
567- log = [ ] ;
565+ 'foo' : 'bar' ,
566+ 'length' : 2
567+ } ,
568+ log = [ ] ;
568569
569- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
570+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
570571 expect ( log ) . toEqual ( [ 'foo:bar' , 'length:2' ] ) ;
571572 } ) ;
572573
573574
574575 it ( 'should handle objects of custom types with length property as objects' , function ( ) {
575576 function CustomType ( ) {
576577 this . length = 2 ;
577- this . foo = 'bar'
578+ this . foo = 'bar' ;
578579 }
579580
580581 var obj = new CustomType ( ) ,
581582 log = [ ] ;
582583
583- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
584+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
584585 expect ( log ) . toEqual ( [ 'length:2' , 'foo:bar' ] ) ;
585586 } ) ;
586587 } ) ;
@@ -748,9 +749,11 @@ describe('angular', function() {
748749 var appElement = jqLite ( '<div ng-app="doesntexist"></div>' ) [ 0 ] ;
749750
750751 expect ( function ( ) {
751- angularInit ( appElement , bootstrap ) ;
752+ angularInit ( appElement , angular . bootstrap ) ;
752753 } ) . toThrowMatching (
753- / \[ \$ i n j e c t o r : m o d u l e r r ] F a i l e d t o i n s t a n t i a t e m o d u l e d o e s n t e x i s t d u e t o : \n .* \[ \$ i n j e c t o r : n o m o d ] M o d u l e ' d o e s n t e x i s t ' i s n o t a v a i l a b l e ! Y o u e i t h e r m i s s p e l l e d t h e m o d u l e n a m e o r f o r g o t t o l o a d i t \. /
754+ new RegExp ( '\\[\\$injector:modulerr] Failed to instantiate module doesntexist due to:\\n' +
755+ '.*\\[\\$injector:nomod] Module \'doesntexist\' is not available! You either ' +
756+ 'misspelled the module name or forgot to load it\\.' )
754757 ) ;
755758 } ) ;
756759
@@ -789,7 +792,7 @@ describe('angular', function() {
789792 expect ( bootstrapSpy . mostRecentCall . args [ 2 ] . strictDi ) . toBe ( true ) ;
790793
791794 var injector = appElement . injector ( ) ;
792- function testFactory ( $rootScope ) { } ;
795+ function testFactory ( $rootScope ) { }
793796 expect ( function ( ) {
794797 injector . instantiate ( testFactory ) ;
795798 } ) . toThrowMinErr ( '$injector' , 'strictdi' ) ;
@@ -956,7 +959,9 @@ describe('angular', function() {
956959 expect ( function ( ) {
957960 angular . bootstrap ( element , [ 'doesntexist' ] ) ;
958961 } ) . toThrowMatching (
959- / \[ \$ i n j e c t o r : m o d u l e r r \] F a i l e d t o i n s t a n t i a t e m o d u l e d o e s n t e x i s t d u e t o : \n .* \[ \$ i n j e c t o r : n o m o d \] M o d u l e ' d o e s n t e x i s t ' i s n o t a v a i l a b l e ! Y o u e i t h e r m i s s p e l l e d t h e m o d u l e n a m e o r f o r g o t t o l o a d i t \. / ) ;
962+ new RegExp ( '\\[\\$injector:modulerr\\] Failed to instantiate module doesntexist due to:\\n' +
963+ '.*\\[\\$injector:nomod\\] Module \'doesntexist\' is not available! You either ' +
964+ 'misspelled the module name or forgot to load it\\.' ) ) ;
960965
961966 expect ( element . html ( ) ) . toBe ( '{{1+2}}' ) ;
962967 dealoc ( element ) ;
0 commit comments