[flow] Allow type casts in array patterns inside arrow parameters (#9069)
This commit is contained in:
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[a: string];
|
||||
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:2)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
([a: string]);
|
||||
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:3)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
([a, [b: string]]);
|
||||
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:7)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
async ([a: string]);
|
||||
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:9)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
async ([a, [b: string]]);
|
||||
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)"
|
||||
}
|
||||
14
packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js
vendored
Normal file
14
packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/input.js
vendored
Normal file
@@ -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;
|
||||
1739
packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json
vendored
Normal file
1739
packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user