fix: throw expect jsx plugin error when an idStart or > is seen (#11774)
* fix: throw expect jsx plugin error when an idStart or > is seen * fix: avoid throwing undefined * add test case
This commit is contained in:
1
packages/babel-parser/test/fixtures/jsx/basic/html-comment/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/jsx/basic/html-comment/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<!--a
|
||||
4
packages/babel-parser/test/fixtures/jsx/basic/html-comment/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/jsx/basic/html-comment/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "script",
|
||||
"plugins": ["jsx", "flow"]
|
||||
}
|
||||
26
packages/babel-parser/test/fixtures/jsx/basic/html-comment/output.json
vendored
Normal file
26
packages/babel-parser/test/fixtures/jsx/basic/html-comment/output.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [],
|
||||
"directives": [],
|
||||
"innerComments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": "a",
|
||||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}
|
||||
}
|
||||
]
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": "a",
|
||||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user