Create parser plugin "topLevelAwait" (#10449)
* Create parser plugin "topLevelAwait" * Update test262 whitelist * Update ts typings * Fix "sourceType: unambiguous" with TLA * Ambiguous tokens after await * Update await %x(0) * typo [skip ci] * Typo [skip ci] Co-Authored-By: Brian Ng <bng412@gmail.com>
This commit is contained in:
@@ -495,11 +495,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
this.state.labels.push(loopLabel);
|
||||
|
||||
let awaitAt = -1;
|
||||
if (
|
||||
(this.scope.inAsync ||
|
||||
(!this.scope.inFunction && this.options.allowAwaitOutsideFunction)) &&
|
||||
this.eatContextual("await")
|
||||
) {
|
||||
if (this.isAwaitAllowed() && this.eatContextual("await")) {
|
||||
awaitAt = this.state.lastTokStart;
|
||||
}
|
||||
this.scope.enter(SCOPE_OTHER);
|
||||
|
||||
Reference in New Issue
Block a user