Skip to content

Commit

Permalink
fix: update chunkStart on missing unicode escape (#13261)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 6, 2021
1 parent 9440318 commit 278193b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 32 deletions.
1 change: 1 addition & 0 deletions packages/babel-parser/src/tokenizer/index.js
Expand Up @@ -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;
}

Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -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": "\\\\"
}
}
],
Expand Down
Expand Up @@ -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\\"
}
}
],
Expand Down
Expand Up @@ -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"
}
}
],
Expand Down

0 comments on commit 278193b

Please sign in to comment.