@@ -1551,7 +1551,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1551
1551
1552
1552
var startSymbol = $interpolate . startSymbol ( ) ,
1553
1553
endSymbol = $interpolate . endSymbol ( ) ,
1554
- denormalizeTemplate = ( startSymbol == '{{' && endSymbol == '}}' )
1554
+ denormalizeTemplate = ( startSymbol === '{{' && endSymbol = == '}}' )
1555
1555
? identity
1556
1556
: function denormalizeTemplate ( template ) {
1557
1557
return template . replace ( / \{ \{ / g, startSymbol ) . replace ( / } } / g, endSymbol ) ;
@@ -1946,7 +1946,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1946
1946
"Unterminated attribute, found '{0}' but no matching '{1}' found." ,
1947
1947
attrStart , attrEnd ) ;
1948
1948
}
1949
- if ( node . nodeType == NODE_TYPE_ELEMENT ) {
1949
+ if ( node . nodeType === NODE_TYPE_ELEMENT ) {
1950
1950
if ( node . hasAttribute ( attrStart ) ) depth ++ ;
1951
1951
if ( node . hasAttribute ( attrEnd ) ) depth -- ;
1952
1952
}
@@ -2132,7 +2132,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2132
2132
nonTlbTranscludeDirective = directive ;
2133
2133
}
2134
2134
2135
- if ( directiveValue == 'element' ) {
2135
+ if ( directiveValue === 'element' ) {
2136
2136
hasElementTranscludeDirective = true ;
2137
2137
terminalPriority = directive . priority ;
2138
2138
$template = $compileNode ;
@@ -2250,7 +2250,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2250
2250
}
2251
2251
compileNode = $template [ 0 ] ;
2252
2252
2253
- if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2253
+ if ( $template . length !== 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2254
2254
throw $compileMinErr ( 'tplrt' ,
2255
2255
"Template for directive '{0}' must have exactly one root element. {1}" ,
2256
2256
directiveName , '' ) ;
@@ -2635,7 +2635,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2635
2635
try {
2636
2636
directive = directives [ i ] ;
2637
2637
if ( ( isUndefined ( maxPriority ) || maxPriority > directive . priority ) &&
2638
- directive . restrict . indexOf ( location ) != - 1 ) {
2638
+ directive . restrict . indexOf ( location ) !== - 1 ) {
2639
2639
if ( startAttrName ) {
2640
2640
directive = inherit ( directive , { $$start : startAttrName , $$end : endAttrName } ) ;
2641
2641
}
@@ -2692,7 +2692,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2692
2692
2693
2693
// reapply the old attributes to the new element
2694
2694
forEach ( dst , function ( value , key ) {
2695
- if ( key . charAt ( 0 ) != '$' ) {
2695
+ if ( key . charAt ( 0 ) !== '$' ) {
2696
2696
if ( src [ key ] && src [ key ] !== value ) {
2697
2697
value += ( key === 'style' ? ';' : ' ' ) + src [ key ] ;
2698
2698
}
@@ -2702,16 +2702,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2702
2702
2703
2703
// copy the new attributes on the old attrs object
2704
2704
forEach ( src , function ( value , key ) {
2705
- if ( key == 'class' ) {
2705
+ if ( key === 'class' ) {
2706
2706
safeAddClass ( $element , value ) ;
2707
2707
dst [ 'class' ] = ( dst [ 'class' ] ? dst [ 'class' ] + ' ' : '' ) + value ;
2708
- } else if ( key == 'style' ) {
2708
+ } else if ( key === 'style' ) {
2709
2709
$element . attr ( 'style' , $element . attr ( 'style' ) + ';' + value ) ;
2710
2710
dst [ 'style' ] = ( dst [ 'style' ] ? dst [ 'style' ] + ';' : '' ) + value ;
2711
2711
// `dst` will never contain hasOwnProperty as DOM parser won't let it.
2712
2712
// You will get an "InvalidCharacterError: DOM Exception 5" error if you
2713
2713
// have an attribute like "has-own-property" or "data-has-own-property", etc.
2714
- } else if ( key . charAt ( 0 ) != '$' && ! dst . hasOwnProperty ( key ) ) {
2714
+ } else if ( key . charAt ( 0 ) !== '$' && ! dst . hasOwnProperty ( key ) ) {
2715
2715
dst [ key ] = value ;
2716
2716
dstAttr [ key ] = srcAttr [ key ] ;
2717
2717
}
@@ -2750,7 +2750,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2750
2750
}
2751
2751
compileNode = $template [ 0 ] ;
2752
2752
2753
- if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2753
+ if ( $template . length !== 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2754
2754
throw $compileMinErr ( 'tplrt' ,
2755
2755
"Template for directive '{0}' must have exactly one root element. {1}" ,
2756
2756
origAsyncDirective . name , templateUrl ) ;
@@ -2778,7 +2778,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2778
2778
childTranscludeFn , $compileNode , origAsyncDirective , preLinkFns , postLinkFns ,
2779
2779
previousCompileContext ) ;
2780
2780
forEach ( $rootElement , function ( node , i ) {
2781
- if ( node == compileNode ) {
2781
+ if ( node === compileNode ) {
2782
2782
$rootElement [ i ] = $compileNode [ 0 ] ;
2783
2783
}
2784
2784
} ) ;
@@ -2903,15 +2903,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2903
2903
2904
2904
2905
2905
function getTrustedContext ( node , attrNormalizedName ) {
2906
- if ( attrNormalizedName == "srcdoc" ) {
2906
+ if ( attrNormalizedName === "srcdoc" ) {
2907
2907
return $sce . HTML ;
2908
2908
}
2909
2909
var tag = nodeName_ ( node ) ;
2910
2910
// maction[xlink:href] can source SVG. It's not limited to <maction>.
2911
- if ( attrNormalizedName == "xlinkHref" ||
2912
- ( tag == "form" && attrNormalizedName == "action" ) ||
2913
- ( tag != "img" && ( attrNormalizedName == "src" ||
2914
- attrNormalizedName == "ngSrc" ) ) ) {
2911
+ if ( attrNormalizedName === "xlinkHref" ||
2912
+ ( tag === "form" && attrNormalizedName = == "action" ) ||
2913
+ ( tag !== "img" && ( attrNormalizedName = == "src" ||
2914
+ attrNormalizedName === "ngSrc" ) ) ) {
2915
2915
return $sce . RESOURCE_URL ;
2916
2916
}
2917
2917
}
@@ -2974,7 +2974,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2974
2974
//skip animations when the first digest occurs (when
2975
2975
//both the new and the old values are the same) since
2976
2976
//the CSS classes are the non-interpolated values
2977
- if ( name === 'class' && newValue != oldValue ) {
2977
+ if ( name === 'class' && newValue !== oldValue ) {
2978
2978
attr . $updateClass ( newValue , oldValue ) ;
2979
2979
} else {
2980
2980
attr . $set ( name , newValue ) ;
@@ -3005,7 +3005,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
3005
3005
3006
3006
if ( $rootElement ) {
3007
3007
for ( i = 0 , ii = $rootElement . length ; i < ii ; i ++ ) {
3008
- if ( $rootElement [ i ] == firstElementToRemove ) {
3008
+ if ( $rootElement [ i ] === firstElementToRemove ) {
3009
3009
$rootElement [ i ++ ] = newNode ;
3010
3010
for ( var j = i , j2 = j + removeCount - 1 ,
3011
3011
jj = $rootElement . length ;
@@ -3308,7 +3308,7 @@ function tokenDifference(str1, str2) {
3308
3308
for ( var i = 0 ; i < tokens1 . length ; i ++ ) {
3309
3309
var token = tokens1 [ i ] ;
3310
3310
for ( var j = 0 ; j < tokens2 . length ; j ++ ) {
3311
- if ( token == tokens2 [ j ] ) continue outer;
3311
+ if ( token === tokens2 [ j ] ) continue outer;
3312
3312
}
3313
3313
values += ( values . length > 0 ? ' ' : '' ) + token ;
3314
3314
}
0 commit comments