Simplify await and yield tracking in params (#9405)

This commit is contained in:
Daniel Tschinder
2019-02-04 13:01:17 -08:00
committed by Nicolò Ribaudo
parent fe71154626
commit 344d35bbe9
20 changed files with 90 additions and 82 deletions

View File

@@ -102,13 +102,9 @@ export default class State {
// where @foo belongs to the outer class and @bar to the inner
decoratorStack: Array<Array<N.Decorator>> = [[]];
// The first yield or await expression inside parenthesized expressions
// and arrow function parameters. It is used to disallow yield and await in
// arrow function parameters.
yieldOrAwaitInPossibleArrowParameters:
| N.YieldExpression
| N.AwaitExpression
| null = null;
// Positions to delayed-check that yield/await does not exist in default parameters.
yieldPos: number = 0;
awaitPos: number = 0;
// Token store.
tokens: Array<Token | N.Comment> = [];