Skip to content

Commit

Permalink
Fix � parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Mar 5, 2022
1 parent d690316 commit de37f2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/babel-parser/src/plugins/jsx/index.js
Expand Up @@ -204,7 +204,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
/* allowNumSeparator */ "bail",
);
if (
codePoint &&
codePoint !== null &&
this.codePointAtPos(this.state.pos) === charCodes.semicolon
) {
++this.state.pos;
Expand Down
Expand Up @@ -3,4 +3,5 @@
&#xABC;
&#00000000000000000000001234;
&#x0000000000000000000000ABC;
&#0000;
</a>
@@ -1,18 +1,18 @@
{
"type": "File",
"start":0,"end":100,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":4,"index":100}},
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":7,"column":4,"index":112}},
"program": {
"type": "Program",
"start":0,"end":100,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":4,"index":100}},
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":7,"column":4,"index":112}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":100,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":4,"index":100}},
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":7,"column":4,"index":112}},
"expression": {
"type": "JSXElement",
"start":0,"end":100,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":4,"index":100}},
"start":0,"end":112,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":7,"column":4,"index":112}},
"openingElement": {
"type": "JSXOpeningElement",
"start":0,"end":3,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":3,"index":3}},
Expand All @@ -26,22 +26,22 @@
},
"closingElement": {
"type": "JSXClosingElement",
"start":96,"end":100,"loc":{"start":{"line":6,"column":0,"index":96},"end":{"line":6,"column":4,"index":100}},
"start":108,"end":112,"loc":{"start":{"line":7,"column":0,"index":108},"end":{"line":7,"column":4,"index":112}},
"name": {
"type": "JSXIdentifier",
"start":98,"end":99,"loc":{"start":{"line":6,"column":2,"index":98},"end":{"line":6,"column":3,"index":99}},
"start":110,"end":111,"loc":{"start":{"line":7,"column":2,"index":110},"end":{"line":7,"column":3,"index":111}},
"name": "a"
}
},
"children": [
{
"type": "JSXText",
"start":3,"end":96,"loc":{"start":{"line":1,"column":3,"index":3},"end":{"line":6,"column":0,"index":96}},
"start":3,"end":108,"loc":{"start":{"line":1,"column":3,"index":3},"end":{"line":7,"column":0,"index":108}},
"extra": {
"rawValue": "\n Ӓ\n\n Ӓ\n\n",
"raw": "\n &#1234;\n &#xABC;\n &#00000000000000000000001234;\n &#x0000000000000000000000ABC;\n"
"rawValue": "\n Ӓ\n\n Ӓ\n\n \u0000\n",
"raw": "\n &#1234;\n &#xABC;\n &#00000000000000000000001234;\n &#x0000000000000000000000ABC;\n &#0000;\n"
},
"value": "\n Ӓ\n\n Ӓ\n\n"
"value": "\n Ӓ\n\n Ӓ\n\n \u0000\n"
}
]
}
Expand Down

0 comments on commit de37f2b

Please sign in to comment.