fix: disallow \8, \9 in strict mode string (#11852)
This commit is contained in:
@@ -1357,6 +1357,8 @@ export default class Tokenizer extends ParserErrors {
|
||||
case charCodes.digit9:
|
||||
if (inTemplate) {
|
||||
return null;
|
||||
} else if (this.state.strict) {
|
||||
this.raise(this.state.pos - 1, Errors.StrictNumericEscape);
|
||||
}
|
||||
// fall through
|
||||
default:
|
||||
@@ -1385,7 +1387,7 @@ export default class Tokenizer extends ParserErrors {
|
||||
if (inTemplate) {
|
||||
return null;
|
||||
} else if (this.state.strict) {
|
||||
this.raise(codePos, Errors.StrictOctalLiteral);
|
||||
this.raise(codePos, Errors.StrictNumericEscape);
|
||||
} else {
|
||||
// This property is used to throw an error for
|
||||
// an octal literal in a directive that occurs prior
|
||||
|
||||
Reference in New Issue
Block a user