@@ -626,7 +626,7 @@ class DelimToken extends CSSParserToken {
626
626
}
627
627
this . value = val ;
628
628
}
629
- toString ( ) { return `DELIM(${ this . val } )` ; }
629
+ toString ( ) { return `DELIM(${ this . value } )` ; }
630
630
toJSON ( ) { return { type :this . type , value :this . value } ; }
631
631
toSource ( ) {
632
632
if ( this . value == "\\" ) return "\\\n" ;
@@ -745,7 +745,7 @@ class DimensionToken extends CSSParserToken {
745
745
toJSON ( ) { return { type :this . type , value :this . value , unit :this . unit } ; }
746
746
toSource ( ) {
747
747
let unit = escapeIdent ( this . unit ) ;
748
- if ( unit [ 0 ] . toLowerCase ( ) == "e" && ( unit [ 1 ] == "-" || digit ( unit [ 1 ] ) ) ) {
748
+ if ( unit [ 0 ] . toLowerCase ( ) == "e" && ( unit [ 1 ] == "-" || digit ( unit [ 1 ] . charCodeAt ( 0 ) ) ) ) {
749
749
// Unit is ambiguous with scinot
750
750
// Remove the leading "e", replace with escape.
751
751
unit = "\\65 " + unit . slice ( 1 , unit . length ) ;
@@ -880,7 +880,7 @@ class TokenStream {
880
880
}
881
881
882
882
function parseerror ( s , msg ) {
883
- console . log ( "Parse error at token " + s . i + ": " + s . tokens [ i ] + ".\n" + msg ) ;
883
+ console . log ( "Parse error at token " + s . i + ": " + s . tokens [ s . i ] + ".\n" + msg ) ;
884
884
return true ;
885
885
}
886
886
@@ -906,7 +906,7 @@ function consumeAStylesheetsContents(s) {
906
906
907
907
function consumeAnAtRule ( s , nested = false ) {
908
908
const token = s . consumeToken ( ) ;
909
- if ( ! token instanceof AtKeywordToken )
909
+ if ( ! ( token instanceof AtKeywordToken ) )
910
910
throw new Error ( "consumeAnAtRule() called with an invalid token stream state." ) ;
911
911
const rule = new AtRule ( token . value ) ;
912
912
while ( 1 ) {
@@ -972,7 +972,7 @@ function looksLikeACustomProperty(tokens) {
972
972
}
973
973
974
974
function consumeABlock ( s ) {
975
- if ( ! s . nextToken ( ) instanceof OpenCurlyToken ) {
975
+ if ( ! ( s . nextToken ( ) instanceof OpenCurlyToken ) ) {
976
976
throw new Error ( "consumeABlock() called with an invalid token stream state." ) ;
977
977
}
978
978
s . discardToken ( ) ;
@@ -1110,7 +1110,7 @@ function consumeASimpleBlock(s) {
1110
1110
}
1111
1111
1112
1112
function consumeAFunction ( s ) {
1113
- if ( ! s . nextToken ( ) instanceof FunctionToken ) {
1113
+ if ( ! ( s . nextToken ( ) instanceof FunctionToken ) ) {
1114
1114
throw new Error ( "consumeAFunction() called with an invalid token stream state." ) ;
1115
1115
}
1116
1116
var func = new Func ( s . consumeToken ( ) . value ) ;
0 commit comments