@@ -87,13 +87,13 @@ Parser.prototype = function(){
87
87
this . _skipCruft ( ) ;
88
88
89
89
//try to read imports - may be more than one
90
- while ( tokenStream . peek ( ) == Tokens . IMPORT_SYM ) {
90
+ while ( tokenStream . peek ( ) === Tokens . IMPORT_SYM ) {
91
91
this . _import ( ) ;
92
92
this . _skipCruft ( ) ;
93
93
}
94
94
95
95
//try to read namespaces - may be more than one
96
- while ( tokenStream . peek ( ) == Tokens . NAMESPACE_SYM ) {
96
+ while ( tokenStream . peek ( ) === Tokens . NAMESPACE_SYM ) {
97
97
this . _namespace ( ) ;
98
98
this . _skipCruft ( ) ;
99
99
}
@@ -146,7 +146,7 @@ Parser.prototype = function(){
146
146
147
147
//skip braces
148
148
count = 0 ;
149
- while ( tokenStream . advance ( [ Tokens . LBRACE , Tokens . RBRACE ] ) == Tokens . LBRACE ) {
149
+ while ( tokenStream . advance ( [ Tokens . LBRACE , Tokens . RBRACE ] ) === Tokens . LBRACE ) {
150
150
count ++ ; //keep track of nesting depth
151
151
}
152
152
@@ -204,7 +204,7 @@ Parser.prototype = function(){
204
204
tt = tokenStream . peek ( ) ;
205
205
}
206
206
207
- if ( tt != Tokens . EOF ) {
207
+ if ( tt !== Tokens . EOF ) {
208
208
this . _unexpectedToken ( tokenStream . token ( ) ) ;
209
209
}
210
210
@@ -366,13 +366,13 @@ Parser.prototype = function(){
366
366
} ) ;
367
367
368
368
while ( true ) {
369
- if ( tokenStream . peek ( ) == Tokens . PAGE_SYM ) {
369
+ if ( tokenStream . peek ( ) === Tokens . PAGE_SYM ) {
370
370
this . _page ( ) ;
371
- } else if ( tokenStream . peek ( ) == Tokens . FONT_FACE_SYM ) {
371
+ } else if ( tokenStream . peek ( ) === Tokens . FONT_FACE_SYM ) {
372
372
this . _font_face ( ) ;
373
- } else if ( tokenStream . peek ( ) == Tokens . VIEWPORT_SYM ) {
373
+ } else if ( tokenStream . peek ( ) === Tokens . VIEWPORT_SYM ) {
374
374
this . _viewport ( ) ;
375
- } else if ( tokenStream . peek ( ) == Tokens . DOCUMENT_SYM ) {
375
+ } else if ( tokenStream . peek ( ) === Tokens . DOCUMENT_SYM ) {
376
376
this . _document ( ) ;
377
377
} else if ( ! this . _ruleset ( ) ) {
378
378
break ;
@@ -404,7 +404,7 @@ Parser.prototype = function(){
404
404
405
405
this . _readWhitespace ( ) ;
406
406
407
- if ( tokenStream . peek ( ) == Tokens . IDENT || tokenStream . peek ( ) == Tokens . LPAREN ) {
407
+ if ( tokenStream . peek ( ) === Tokens . IDENT || tokenStream . peek ( ) = == Tokens . LPAREN ) {
408
408
mediaList . push ( this . _media_query ( ) ) ;
409
409
}
410
410
@@ -438,7 +438,7 @@ Parser.prototype = function(){
438
438
ident = tokenStream . token ( ) . value . toLowerCase ( ) ;
439
439
440
440
//since there's no custom tokens for these, need to manually check
441
- if ( ident != "only" && ident != "not" ) {
441
+ if ( ident !== "only" && ident != = "not" ) {
442
442
tokenStream . unget ( ) ;
443
443
ident = null ;
444
444
} else {
@@ -448,12 +448,12 @@ Parser.prototype = function(){
448
448
449
449
this . _readWhitespace ( ) ;
450
450
451
- if ( tokenStream . peek ( ) == Tokens . IDENT ) {
451
+ if ( tokenStream . peek ( ) === Tokens . IDENT ) {
452
452
type = this . _media_type ( ) ;
453
453
if ( token === null ) {
454
454
token = tokenStream . token ( ) ;
455
455
}
456
- } else if ( tokenStream . peek ( ) == Tokens . LPAREN ) {
456
+ } else if ( tokenStream . peek ( ) === Tokens . LPAREN ) {
457
457
if ( token === null ) {
458
458
token = tokenStream . LT ( 1 ) ;
459
459
}
@@ -465,7 +465,7 @@ Parser.prototype = function(){
465
465
} else {
466
466
this . _readWhitespace ( ) ;
467
467
while ( tokenStream . match ( Tokens . IDENT ) ) {
468
- if ( tokenStream . token ( ) . value . toLowerCase ( ) != "and" ) {
468
+ if ( tokenStream . token ( ) . value . toLowerCase ( ) !== "and" ) {
469
469
this . _unexpectedToken ( tokenStream . token ( ) ) ;
470
470
}
471
471
@@ -570,7 +570,7 @@ Parser.prototype = function(){
570
570
}
571
571
572
572
//see if there's a colon upcoming
573
- if ( tokenStream . peek ( ) == Tokens . COLON ) {
573
+ if ( tokenStream . peek ( ) === Tokens . COLON ) {
574
574
pseudoPage = this . _pseudo_page ( ) ;
575
575
}
576
576
@@ -798,13 +798,13 @@ Parser.prototype = function(){
798
798
} ) ;
799
799
800
800
while ( true ) {
801
- if ( tokenStream . peek ( ) == Tokens . PAGE_SYM ) {
801
+ if ( tokenStream . peek ( ) === Tokens . PAGE_SYM ) {
802
802
this . _page ( ) ;
803
- } else if ( tokenStream . peek ( ) == Tokens . FONT_FACE_SYM ) {
803
+ } else if ( tokenStream . peek ( ) === Tokens . FONT_FACE_SYM ) {
804
804
this . _font_face ( ) ;
805
- } else if ( tokenStream . peek ( ) == Tokens . VIEWPORT_SYM ) {
805
+ } else if ( tokenStream . peek ( ) === Tokens . VIEWPORT_SYM ) {
806
806
this . _viewport ( ) ;
807
- } else if ( tokenStream . peek ( ) == Tokens . MEDIA_SYM ) {
807
+ } else if ( tokenStream . peek ( ) === Tokens . MEDIA_SYM ) {
808
808
this . _media ( ) ;
809
809
} else if ( ! this . _ruleset ( ) ) {
810
810
break ;
@@ -920,7 +920,7 @@ Parser.prototype = function(){
920
920
col ;
921
921
922
922
//check for star hack - throws error if not allowed
923
- if ( tokenStream . peek ( ) == Tokens . STAR && this . options . starHack ) {
923
+ if ( tokenStream . peek ( ) === Tokens . STAR && this . options . starHack ) {
924
924
tokenStream . get ( ) ;
925
925
token = tokenStream . token ( ) ;
926
926
hack = token . value ;
@@ -933,7 +933,7 @@ Parser.prototype = function(){
933
933
tokenValue = token . value ;
934
934
935
935
//check for underscore hack - no error if not allowed because it's valid CSS syntax
936
- if ( tokenValue . charAt ( 0 ) == "_" && this . options . underscoreHack ) {
936
+ if ( tokenValue . charAt ( 0 ) === "_" && this . options . underscoreHack ) {
937
937
hack = "_" ;
938
938
tokenValue = tokenValue . substring ( 1 ) ;
939
939
}
@@ -979,7 +979,7 @@ Parser.prototype = function(){
979
979
980
980
//skip over everything until closing brace
981
981
tt = tokenStream . advance ( [ Tokens . RBRACE ] ) ;
982
- if ( tt == Tokens . RBRACE ) {
982
+ if ( tt === Tokens . RBRACE ) {
983
983
//if there's a right brace, the rule is finished so don't do anything
984
984
} else {
985
985
//otherwise, rethrow the error because it wasn't handled properly
@@ -1418,7 +1418,7 @@ Parser.prototype = function(){
1418
1418
pseudo = tokenStream . token ( ) . value ;
1419
1419
line = tokenStream . token ( ) . startLine ;
1420
1420
col = tokenStream . token ( ) . startCol - colons . length ;
1421
- } else if ( tokenStream . peek ( ) == Tokens . FUNCTION ) {
1421
+ } else if ( tokenStream . peek ( ) === Tokens . FUNCTION ) {
1422
1422
line = tokenStream . LT ( 1 ) . startLine ;
1423
1423
col = tokenStream . LT ( 1 ) . startCol - colons . length ;
1424
1424
pseudo = this . _functional_pseudo ( ) ;
@@ -1555,7 +1555,7 @@ Parser.prototype = function(){
1555
1555
}
1556
1556
1557
1557
//it's an element name
1558
- if ( arg . type == "elementName" ) {
1558
+ if ( arg . type === "elementName" ) {
1559
1559
part = new SelectorPart ( arg , [ ] , arg . toString ( ) , line , col ) ;
1560
1560
} else {
1561
1561
part = new SelectorPart ( null , [ arg ] , arg . toString ( ) , line , col ) ;
@@ -1602,8 +1602,8 @@ Parser.prototype = function(){
1602
1602
* _property or *property as invalid properties.
1603
1603
*/
1604
1604
propertyName = property . toString ( ) ;
1605
- if ( this . options . starHack && property . hack == "*" ||
1606
- this . options . underscoreHack && property . hack == "_" ) {
1605
+ if ( this . options . starHack && property . hack === "*" ||
1606
+ this . options . underscoreHack && property . hack === "_" ) {
1607
1607
1608
1608
propertyName = property . text ;
1609
1609
}
@@ -1719,7 +1719,7 @@ Parser.prototype = function(){
1719
1719
}
1720
1720
1721
1721
//exception for IE filters
1722
- if ( tokenStream . peek ( ) == Tokens . IE_FUNCTION && this . options . ieFilters ) {
1722
+ if ( tokenStream . peek ( ) === Tokens . IE_FUNCTION && this . options . ieFilters ) {
1723
1723
1724
1724
value = this . _ie_function ( ) ;
1725
1725
if ( unary === null ) {
@@ -1771,7 +1771,7 @@ Parser.prototype = function(){
1771
1771
* This checks for alpha(opacity=0) style of IE
1772
1772
* functions. IE_FUNCTION only presents progid: style.
1773
1773
*/
1774
- if ( tokenStream . LA ( 3 ) == Tokens . EQUALS && this . options . ieFilters ) {
1774
+ if ( tokenStream . LA ( 3 ) === Tokens . EQUALS && this . options . ieFilters ) {
1775
1775
value = this . _ie_function ( ) ;
1776
1776
} else {
1777
1777
value = this . _function ( ) ;
@@ -1819,15 +1819,15 @@ Parser.prototype = function(){
1819
1819
functionText += expr ;
1820
1820
1821
1821
//START: Horrible hack in case it's an IE filter
1822
- if ( this . options . ieFilters && tokenStream . peek ( ) == Tokens . EQUALS ) {
1822
+ if ( this . options . ieFilters && tokenStream . peek ( ) === Tokens . EQUALS ) {
1823
1823
do {
1824
1824
1825
1825
if ( this . _readWhitespace ( ) ) {
1826
1826
functionText += tokenStream . token ( ) . value ;
1827
1827
}
1828
1828
1829
1829
//might be second time in the loop
1830
- if ( tokenStream . LA ( 0 ) == Tokens . COMMA ) {
1830
+ if ( tokenStream . LA ( 0 ) === Tokens . COMMA ) {
1831
1831
functionText += tokenStream . token ( ) . value ;
1832
1832
}
1833
1833
@@ -1839,7 +1839,7 @@ Parser.prototype = function(){
1839
1839
1840
1840
//functionText += this._term();
1841
1841
lt = tokenStream . peek ( ) ;
1842
- while ( lt != Tokens . COMMA && lt != Tokens . S && lt != Tokens . RPAREN ) {
1842
+ while ( lt !== Tokens . COMMA && lt !== Tokens . S && lt != = Tokens . RPAREN ) {
1843
1843
tokenStream . get ( ) ;
1844
1844
functionText += tokenStream . token ( ) . value ;
1845
1845
lt = tokenStream . peek ( ) ;
@@ -1881,7 +1881,7 @@ Parser.prototype = function(){
1881
1881
}
1882
1882
1883
1883
//might be second time in the loop
1884
- if ( tokenStream . LA ( 0 ) == Tokens . COMMA ) {
1884
+ if ( tokenStream . LA ( 0 ) === Tokens . COMMA ) {
1885
1885
functionText += tokenStream . token ( ) . value ;
1886
1886
}
1887
1887
@@ -1893,7 +1893,7 @@ Parser.prototype = function(){
1893
1893
1894
1894
//functionText += this._term();
1895
1895
lt = tokenStream . peek ( ) ;
1896
- while ( lt != Tokens . COMMA && lt != Tokens . S && lt != Tokens . RPAREN ) {
1896
+ while ( lt !== Tokens . COMMA && lt !== Tokens . S && lt != = Tokens . RPAREN ) {
1897
1897
tokenStream . get ( ) ;
1898
1898
functionText += tokenStream . token ( ) . value ;
1899
1899
lt = tokenStream . peek ( ) ;
@@ -1979,7 +1979,7 @@ Parser.prototype = function(){
1979
1979
tt = tokenStream . peek ( ) ;
1980
1980
1981
1981
//check for key
1982
- while ( tt == Tokens . IDENT || tt == Tokens . PERCENTAGE ) {
1982
+ while ( tt === Tokens . IDENT || tt = == Tokens . PERCENTAGE ) {
1983
1983
this . _keyframe_rule ( ) ;
1984
1984
this . _readWhitespace ( ) ;
1985
1985
tt = tokenStream . peek ( ) ;
@@ -2186,10 +2186,10 @@ Parser.prototype = function(){
2186
2186
2187
2187
//see if there's another declaration
2188
2188
tt = tokenStream . advance ( [ Tokens . SEMICOLON , Tokens . RBRACE ] ) ;
2189
- if ( tt == Tokens . SEMICOLON ) {
2189
+ if ( tt === Tokens . SEMICOLON ) {
2190
2190
//if there's a semicolon, then there might be another declaration
2191
2191
this . _readDeclarations ( false , readMargins ) ;
2192
- } else if ( tt != Tokens . RBRACE ) {
2192
+ } else if ( tt !== Tokens . RBRACE ) {
2193
2193
//if there's a right brace, the rule is finished so don't do anything
2194
2194
//otherwise, rethrow the error because it wasn't handled properly
2195
2195
throw ex ;
@@ -2243,7 +2243,7 @@ Parser.prototype = function(){
2243
2243
* @private
2244
2244
*/
2245
2245
_verifyEnd : function ( ) {
2246
- if ( this . _tokenStream . LA ( 1 ) != Tokens . EOF ) {
2246
+ if ( this . _tokenStream . LA ( 1 ) !== Tokens . EOF ) {
2247
2247
this . _unexpectedToken ( this . _tokenStream . LT ( 1 ) ) ;
2248
2248
}
2249
2249
} ,
0 commit comments