fix: update chunkStart on missing unicode escape (#13261)
This commit is contained in:
parent
9440318309
commit
278193b6f7
@ -1462,6 +1462,7 @@ export default class Tokenizer extends ParserErrors {
|
||||
|
||||
if (this.input.charCodeAt(++this.state.pos) !== charCodes.lowercaseU) {
|
||||
this.raise(this.state.pos, Errors.MissingUnicodeEscape);
|
||||
chunkStart = this.state.pos - 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
x\
|
||||
@ -1,25 +0,0 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}},
|
||||
"errors": [
|
||||
"SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:2)"
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"xx\\"},
|
||||
"name": "xx\\"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@ -16,8 +16,8 @@
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"\\\\\\"},
|
||||
"name": "\\\\\\"
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"\\\\"},
|
||||
"name": "\\\\"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"xx\\"},
|
||||
"name": "xx\\"
|
||||
"start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"x\\"},
|
||||
"name": "x\\"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"aa\\a"},
|
||||
"name": "aa\\a"
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"a\\a"},
|
||||
"name": "a\\a"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user