Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disallow expression after binding identifier
of
(#11355)
- Loading branch information
Showing
11 changed files
with
174 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
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
2 changes: 2 additions & 0 deletions
2
packages/babel-parser/test/fixtures/flow/regression/issue-10675-class/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,2 @@ | ||
class of<T> {} | ||
|
7 changes: 7 additions & 0 deletions
7
packages/babel-parser/test/fixtures/flow/regression/issue-10675-class/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,7 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": [ | ||
"jsx", | ||
"flow" | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/babel-parser/test/fixtures/flow/regression/issue-10675-class/output.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,40 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"of"}, | ||
"name": "of" | ||
}, | ||
"typeParameters": { | ||
"type": "TypeParameterDeclaration", | ||
"start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, | ||
"params": [ | ||
{ | ||
"type": "TypeParameter", | ||
"start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, | ||
"name": "T", | ||
"variance": null | ||
} | ||
] | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":12,"end":14,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":14}}, | ||
"body": [] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/babel-parser/test/fixtures/flow/regression/issue-10675-function/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,2 @@ | ||
function of<T>() {} | ||
|
7 changes: 7 additions & 0 deletions
7
packages/babel-parser/test/fixtures/flow/regression/issue-10675-function/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,7 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": [ | ||
"jsx", | ||
"flow" | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
packages/babel-parser/test/fixtures/flow/regression/issue-10675-function/output.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,43 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "FunctionDeclaration", | ||
"start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"of"}, | ||
"name": "of" | ||
}, | ||
"generator": false, | ||
"async": false, | ||
"typeParameters": { | ||
"type": "TypeParameterDeclaration", | ||
"start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, | ||
"params": [ | ||
{ | ||
"type": "TypeParameter", | ||
"start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, | ||
"name": "T", | ||
"variance": null | ||
} | ||
] | ||
}, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/babel-parser/test/fixtures/flow/regression/issue-10675-interface/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,2 @@ | ||
interface of<T> {} | ||
|
7 changes: 7 additions & 0 deletions
7
packages/babel-parser/test/fixtures/flow/regression/issue-10675-interface/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,7 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": [ | ||
"jsx", | ||
"flow" | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/babel-parser/test/fixtures/flow/regression/issue-10675-interface/output.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,46 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "InterfaceDeclaration", | ||
"start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"of"}, | ||
"name": "of" | ||
}, | ||
"typeParameters": { | ||
"type": "TypeParameterDeclaration", | ||
"start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, | ||
"params": [ | ||
{ | ||
"type": "TypeParameter", | ||
"start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}}, | ||
"name": "T", | ||
"variance": null | ||
} | ||
] | ||
}, | ||
"extends": [], | ||
"implements": [], | ||
"mixins": [], | ||
"body": { | ||
"type": "ObjectTypeAnnotation", | ||
"start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, | ||
"callProperties": [], | ||
"properties": [], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |