Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not throw an error for optional binding pattern params in function…
… declaration (#12085)
- Loading branch information
1 parent
18d13d0
commit 3628c52
Showing
3 changed files
with
40 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/typescript/function/declare-pattern-parameters/input.ts
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 @@ | ||
declare function f([]?, {}) |
38 changes: 38 additions & 0 deletions
38
...ges/babel-parser/test/fixtures/typescript/function/declare-pattern-parameters/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,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "TSDeclareFunction", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"declare": true, | ||
"id": { | ||
"type": "Identifier", | ||
"start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"f"}, | ||
"name": "f" | ||
}, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "ArrayPattern", | ||
"start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, | ||
"elements": [], | ||
"optional": true | ||
}, | ||
{ | ||
"type": "ObjectPattern", | ||
"start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, | ||
"properties": [] | ||
} | ||
] | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |