-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Bug Report
Current Behavior
Minor AST issue; The \8 and \9 are illegal escapes. In tagged template these should be recognized as bad escapes and set the .value property in the AST to null to reflect this.
Input Code
`\8``\9`Expected behavior/code
For templates, an escape \8 and \9 end up as NotEscapeSequence
https://tc39.es/ecma262/#prod-NotEscapeSequence
The string value of that escape is undefined:
https://tc39.es/ecma262/#sec-static-semantics-tv-and-trv
The TV of TemplateCharacter ::
\NotEscapeSequence isundefined.
As such, the .value property in the AST nodes should be null to reflect this, like with other bad escapes.
Environment
Babel 7.5.5
Possible Solution
I think there's an exception to 8 and 9. Do the same as happens with \1 ~ \7. This is for tagged templates only.