6
6
//problems with requirejs.exec()/transpiler plugins that may not be strict.
7
7
/*jslint regexp: true, nomen: true, sloppy: true */
8
8
/*global window, navigator, document, importScripts, setTimeout, opera */ // eslint-disable-line no-redeclare
9
+ /* eslint-disable strict */
9
10
10
11
var requirejs , require , define ;
11
12
( function ( global , setTimeout ) {
@@ -95,7 +96,7 @@ var requirejs, require, define;
95
96
function eachProp ( obj , func ) {
96
97
var prop ;
97
98
for ( prop in obj ) {
98
- if ( hasProp ( obj , prop ) && disallowedProps . indexOf ( prop ) == - 1 ) {
99
+ if ( hasProp ( obj , prop ) && disallowedProps . indexOf ( prop ) === - 1 ) {
99
100
if ( func ( obj [ prop ] , prop ) ) {
100
101
break ;
101
102
}
@@ -308,7 +309,7 @@ var requirejs, require, define;
308
309
309
310
outerLoop: for ( i = nameParts . length ; i > 0 ; i -= 1 ) {
310
311
nameSegment = nameParts . slice ( 0 , i ) . join ( '/' ) ;
311
-
312
+ /* eslint-disable max-depth */
312
313
if ( baseParts ) {
313
314
//Find the longest baseName segment match in the config.
314
315
//So, do joins on the biggest to smallest lengths of baseParts.
@@ -328,6 +329,7 @@ var requirejs, require, define;
328
329
}
329
330
}
330
331
}
332
+ /* eslint-enable max-depth */
331
333
332
334
//Check for a star map match, but just hold on to it,
333
335
//if there is a shorter segment match later in a matching
@@ -445,7 +447,7 @@ var requirejs, require, define;
445
447
normalizedName = name ;
446
448
} else if ( pluginModule && pluginModule . normalize ) {
447
449
//Plugin is loaded, use its normalize method.
448
- normalizedName = pluginModule . normalize ( name , function ( name ) {
450
+ normalizedName = pluginModule . normalize ( name , function ( name ) { // eslint-disable-line no-shadow
449
451
return normalize ( name , parentName , applyMap ) ;
450
452
} ) ;
451
453
} else {
@@ -591,16 +593,16 @@ var requirejs, require, define;
591
593
'module' : function ( mod ) {
592
594
if ( mod . module ) {
593
595
return mod . module ;
594
- } else {
595
- return ( mod . module = {
596
- id : mod . map . id ,
597
- uri : mod . map . url ,
598
- config : function ( ) {
599
- return getOwn ( config . config , mod . map . id ) || { } ;
600
- } ,
601
- exports : mod . exports || ( mod . exports = { } )
602
- } ) ;
603
596
}
597
+ /* eslint-disable no-extra-parens */
598
+ return ( mod . module = {
599
+ id : mod . map . id ,
600
+ uri : mod . map . url ,
601
+ config : function ( ) {
602
+ return getOwn ( config . config , mod . map . id ) || { } ;
603
+ } ,
604
+ exports : mod . exports || ( mod . exports = { } )
605
+ } ) ;
604
606
}
605
607
} ;
606
608
@@ -1178,7 +1180,7 @@ var requirejs, require, define;
1178
1180
} ,
1179
1181
1180
1182
on : function ( name , cb ) {
1181
- var cbs = this . events [ name ] ;
1183
+ var cbs = this . events [ name ] ; // eslint-disable-line newline-after-var
1182
1184
if ( ! cbs ) {
1183
1185
cbs = this . events [ name ] = [ ] ;
1184
1186
}
@@ -1715,7 +1717,7 @@ var requirejs, require, define;
1715
1717
interactiveScript = null ;
1716
1718
1717
1719
//Pull out the name of the module and the context.
1718
- var data = getScriptData ( evt ) ;
1720
+ var data = getScriptData ( evt ) ; // eslint-disable vars-on-top
1719
1721
context . completeLoad ( data . id ) ;
1720
1722
}
1721
1723
} ,
@@ -1727,7 +1729,7 @@ var requirejs, require, define;
1727
1729
var data = getScriptData ( evt ) ;
1728
1730
if ( ! hasPathFallback ( data . id ) ) {
1729
1731
var parents = [ ] ;
1730
- eachProp ( registry , function ( value , key ) {
1732
+ eachProp ( registry , function ( value , key ) {
1731
1733
if ( key . indexOf ( '_@r' ) !== 0 ) {
1732
1734
each ( value . depMaps , function ( depMap ) {
1733
1735
if ( depMap . id === data . id ) {
@@ -1908,7 +1910,8 @@ var requirejs, require, define;
1908
1910
//that do not match the behavior of all other browsers with
1909
1911
//addEventListener support, which fire the onload event for a
1910
1912
//script right after the script execution. See:
1911
- //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
1913
+ //https://connect.microsoft.com/IE/feedback/details/648057/
1914
+ // script-onload-event-is-not-fired-immediately-after-script-execution
1912
1915
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
1913
1916
//script execution mode.
1914
1917
if ( node . attachEvent &&
@@ -2139,7 +2142,7 @@ var requirejs, require, define;
2139
2142
*/
2140
2143
req . exec = function ( text ) {
2141
2144
/*jslint evil: true */
2142
- return eval ( text ) ;
2145
+ return eval ( text ) ; // eslint-disable-line no-eval
2143
2146
} ;
2144
2147
2145
2148
//Set up with config info.
0 commit comments