@@ -619,7 +619,7 @@ class DelimToken extends CSSParserToken {
619
619
}
620
620
this . value = val ;
621
621
}
622
- toString ( ) { return `DELIM(${ this . value } )` ; }
622
+ toString ( ) { return `DELIM(${ JSON . stringify ( this . value ) } )` ; }
623
623
toJSON ( ) { return { type :this . type , value :this . value } ; }
624
624
toSource ( ) {
625
625
if ( this . value == "\\" ) return "\\\n" ;
@@ -632,7 +632,7 @@ class IdentToken extends CSSParserToken {
632
632
super ( "IDENT" ) ;
633
633
this . value = val ;
634
634
}
635
- toString ( ) { return `IDENT(${ this . value } )` ; }
635
+ toString ( ) { return `IDENT(${ JSON . stringify ( this . value ) } )` ; }
636
636
toJSON ( ) { return { type :this . type , value :this . value } ; }
637
637
toSource ( ) { return escapeIdent ( this . value ) ; }
638
638
}
@@ -643,7 +643,7 @@ class FunctionToken extends CSSParserToken {
643
643
this . value = val ;
644
644
this . mirror = CloseParenToken ;
645
645
}
646
- toString ( ) { return `FUNCTION(${ this . value } )` ; }
646
+ toString ( ) { return `FUNCTION(${ JSON . stringify ( this . value ) } )` ; }
647
647
toJSON ( ) { return { type :this . type , value :this . value } ; }
648
648
toSource ( ) { return escapeIdent ( this . value ) + "(" ; }
649
649
}
@@ -653,7 +653,7 @@ class AtKeywordToken extends CSSParserToken {
653
653
super ( "AT-KEYWORD" ) ;
654
654
this . value = val ;
655
655
}
656
- toString ( ) { return `AT(${ this . value } )` ; }
656
+ toString ( ) { return `AT(${ JSON . stringify ( this . value ) } )` ; }
657
657
toJSON ( ) { return { type :this . type , value :this . value } ; }
658
658
toSource ( ) { return "@" + escapeIdent ( this . value ) ; }
659
659
}
@@ -664,7 +664,7 @@ class HashToken extends CSSParserToken {
664
664
this . value = val ;
665
665
this . isIdent = isIdent ;
666
666
}
667
- toString ( ) { return `HASH(${ this . value } )` ; }
667
+ toString ( ) { return `HASH(${ JSON . stringify ( this . value ) } )` ; }
668
668
toJSON ( ) { return { type :this . type , value :this . value , isIdent :this . isIdent } ; }
669
669
toSource ( ) {
670
670
if ( this . isIdent ) {
@@ -679,7 +679,7 @@ class StringToken extends CSSParserToken {
679
679
super ( "STRING" ) ;
680
680
this . value = val ;
681
681
}
682
- toString ( ) { return `STRING(${ this . value } )` ; }
682
+ toString ( ) { return `STRING(${ JSON . stringify ( this . value ) } )` ; }
683
683
toJSON ( ) { return { type :this . type , value :this . value } ; }
684
684
toSource ( ) { return `"${ escapeString ( this . value ) } "` ; }
685
685
}
@@ -689,7 +689,7 @@ class URLToken extends CSSParserToken {
689
689
super ( "URL" ) ;
690
690
this . value = val ;
691
691
}
692
- toString ( ) { return `URL(${ this . value } )` ; }
692
+ toString ( ) { return `URL(${ JSON . stringify ( this . value ) } )` ; }
693
693
toJSON ( ) { return { type :this . type , value :this . value } ; }
694
694
toSource ( ) { return `url("${ escapeString ( this . value ) } ")` ; }
695
695
}
@@ -732,7 +732,7 @@ class DimensionToken extends CSSParserToken {
732
732
this . sign = sign ;
733
733
}
734
734
toString ( ) {
735
- return `DIM(${ formatNumber ( this . value , this . sign ) } , ${ this . unit } )` ;
735
+ return `DIM(${ formatNumber ( this . value , this . sign ) } , ${ JSON . stringify ( this . unit ) } )` ;
736
736
}
737
737
toJSON ( ) { return { type :this . type , value :this . value , isInteger :this . isInteger , unit :this . unit , sign :this . sign } ; }
738
738
toSource ( ) {
0 commit comments