[parser] Exception to 8 and 9 in tagged template (#10567)

This commit is contained in:
piotr
2019-10-17 00:01:22 +02:00
committed by Nicolò Ribaudo
parent 2254542010
commit 5800fc97b3
5 changed files with 16 additions and 0 deletions

View File

@@ -1239,6 +1239,14 @@ export default class Tokenizer extends LocationParser {
case charCodes.lineSeparator:
case charCodes.paragraphSeparator:
return "";
case charCodes.digit8:
case charCodes.digit9:
if (inTemplate) {
const codePos = this.state.pos - 1;
this.state.invalidTemplateEscapePosition = codePos;
return null;
}
default:
if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {
const codePos = this.state.pos - 1;