diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index 6344996fe4f2..f65b28476cd0 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -204,7 +204,7 @@ export default (superClass: Class): Class => /* allowNumSeparator */ "bail", ); if ( - codePoint && + codePoint !== null && this.codePointAtPos(this.state.pos) === charCodes.semicolon ) { ++this.state.pos; diff --git a/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/input.js b/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/input.js index 1578ea516db1..9867befe0ece 100644 --- a/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/input.js +++ b/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/input.js @@ -3,4 +3,5 @@ ઼ Ӓ ઼ + � diff --git a/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/output.json b/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/output.json index 727c467c1a42..c53f68eb4fff 100644 --- a/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/output.json +++ b/packages/babel-parser/test/fixtures/jsx/html-entities/code-point/output.json @@ -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}}, @@ -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 Ӓ\n ઼\n Ӓ\n ઼\n" + "rawValue": "\n Ӓ\n ઼\n Ӓ\n ઼\n \u0000\n", + "raw": "\n Ӓ\n ઼\n Ӓ\n ઼\n �\n" }, - "value": "\n Ӓ\n ઼\n Ӓ\n ઼\n" + "value": "\n Ӓ\n ઼\n Ӓ\n ઼\n \u0000\n" } ] }