Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
12 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/es2015/modules/invalid-xml-comment-in-module/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--bar--> |
4 changes: 4 additions & 0 deletions
4
...ages/babel-parser/test/fixtures/es2015/modules/invalid-xml-comment-in-module/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"sourceType": "module", | ||
"throws": "Unexpected token (1:0)" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function foo () { | ||
return ( | ||
<>Hello</> | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/babel-parser/test/fixtures/jsx/errors/_no-plugin-fragment/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (3:4)", | ||
"plugins": [] | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
< | ||
𠮷 | ||
></ | ||
𠮷 | ||
> |
4 changes: 4 additions & 0 deletions
4
packages/babel-parser/test/fixtures/jsx/errors/_no_plugin-non-BMP-identifier/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (1:0)", | ||
"plugins": [] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--a |
5 changes: 5 additions & 0 deletions
5
packages/babel-parser/test/fixtures/jsx/errors/html-comment-module/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Unexpected token (1:0)" | ||
} |