Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not allow member expressions to start async arrows (#10332)
* Do not allow member expressions to start async arrows * Boolean -> boolean
- Loading branch information
1 parent
94fcabc
commit 80d99b4
Showing
6 changed files
with
210 additions
and
24 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
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
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/regression/issue-10314/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,3 @@ | ||
// @flow | ||
|
||
true ? async.waterfall() : null; |
198 changes: 198 additions & 0 deletions
198
packages/babel-parser/test/fixtures/flow/regression/issue-10314/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,198 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 32 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 32 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 10, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 32 | ||
} | ||
}, | ||
"expression": { | ||
"type": "ConditionalExpression", | ||
"start": 10, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 31 | ||
} | ||
}, | ||
"test": { | ||
"type": "BooleanLiteral", | ||
"start": 10, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 4 | ||
} | ||
}, | ||
"value": true | ||
}, | ||
"consequent": { | ||
"type": "CallExpression", | ||
"start": 17, | ||
"end": 34, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 24 | ||
} | ||
}, | ||
"callee": { | ||
"type": "MemberExpression", | ||
"start": 17, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 22 | ||
} | ||
}, | ||
"object": { | ||
"type": "Identifier", | ||
"start": 17, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 12 | ||
}, | ||
"identifierName": "async" | ||
}, | ||
"name": "async" | ||
}, | ||
"property": { | ||
"type": "Identifier", | ||
"start": 23, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 22 | ||
}, | ||
"identifierName": "waterfall" | ||
}, | ||
"name": "waterfall" | ||
}, | ||
"computed": false | ||
}, | ||
"arguments": [] | ||
}, | ||
"alternate": { | ||
"type": "NullLiteral", | ||
"start": 37, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 27 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 31 | ||
} | ||
} | ||
} | ||
}, | ||
"leadingComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " @flow", | ||
"start": 0, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"directives": [] | ||
}, | ||
"comments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " @flow", | ||
"start": 0, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
] | ||
} |