Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check await when parsing AsyncArrowBindingIdentifier (#10953)
- Loading branch information
1 parent
467667a
commit a283537
Showing
3 changed files
with
118 additions
and
0 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
1 change: 1 addition & 0 deletions
1
...ser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/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 await => {} |
107 changes: 107 additions & 0 deletions
107
.../test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/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,107 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"errors": [ | ||
"SyntaxError: Await cannot be used as name inside an async function (1:6)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start": 0, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"id": null, | ||
"generator": false, | ||
"async": true, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"start": 6, | ||
"end": 11, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"identifierName": "await" | ||
}, | ||
"name": "await" | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start": 15, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |