Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Allow type casts in array patterns inside arrow parameters (#9069
- Loading branch information
1 parent
d2971a1
commit 856edbf
Showing
15 changed files
with
1,801 additions
and
6 deletions.
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
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/flow/typecasts/fails-in-array-expression-1/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: string]; |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/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,3 @@ | ||
{ | ||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:2)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/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: string]); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/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,3 @@ | ||
{ | ||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:3)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/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, [b: string]]); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/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,3 @@ | ||
{ | ||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:7)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/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 @@ | ||
async ([a: string]); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/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,3 @@ | ||
{ | ||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:9)" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/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 @@ | ||
async ([a, [b: string]]); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/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,3 @@ | ||
{ | ||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)" | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/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,14 @@ | ||
([a: string]) => {}; | ||
([a, [b: string]]) => {}; | ||
([a: string] = []) => {}; | ||
({ x: [a: string] }) => {}; | ||
|
||
async ([a: string]) => {}; | ||
async ([a, [b: string]]) => {}; | ||
async ([a: string] = []) => {}; | ||
async ({ x: [a: string] }) => {}; | ||
|
||
let [a: string] = c; | ||
let [a, [b: string]] = c; | ||
let [a: string] = c; | ||
let { x: [a: string] } = c; |
Oops, something went wrong.