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/es2015/modules/invalid-xml-comment-in-module/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/es2015/modules/invalid-xml-comment-in-module/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<!--bar-->
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (1:0)"
|
||||
}
|
||||
5
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/input.js
vendored
Normal file
5
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/input.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
function foo () {
|
||||
return (
|
||||
<>Hello</>
|
||||
);
|
||||
}
|
||||
4
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (3:4)",
|
||||
"plugins": []
|
||||
}
|
||||
5
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/input.js
vendored
Normal file
5
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/input.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<
|
||||
𠮷
|
||||
></
|
||||
𠮷
|
||||
>
|
||||
4
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (1:0)",
|
||||
"plugins": []
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<!--a
|
||||
5
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/options.json
vendored
Normal file
5
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/options.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": ["jsx", "flow"],
|
||||
"throws": "Unexpected token (1:0)"
|
||||
}
|
||||
Reference in New Issue
Block a user