Closed ascidian closed 3 years ago
eval("'\u2028'")
executes without error in a quick test on v8 and jsc
I agree with @ascidian's interpretation of the spec that these characters should be allowed
the spec for DoubleStringCharacter
starts with
SourceCharacter but not one of " or \ or LineTerminator
and while LineTerminator
includes:
U+000A LINE FEED (LF) <LF>
U+000D CARRIAGE RETURN (CR) <CR>
U+2028 LINE SEPARATOR <LS>
U+2029 PARAGRAPH SEPARATOR <PS>
the spec continues to explicitly allow
<LS>
<PS>
here is an example of <LS>
in the wild (albeit in json) https://npmfs.com/package/unicode-confusables/0.1.1/data/confusables.json#L160
Fixed by #30.
Per specification https://tc39.es/ecma262/#prod-StringLiteral, <LS> and <PS> are valid characters in string literals
The following two tests must pass: fail/647e21f8f157c338.js fail/8af69d8f15295ed2.js