Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Oct 14, 2022
1 parent f9e12dd commit 4f0e6ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-parser/src/parser/statement.ts
Expand Up @@ -319,7 +319,7 @@ export default abstract class StatementParser extends ExpressionParser {

startsUsingForOf(): boolean {
const lookahead = this.lookahead();
if (lookahead.type === tt._of && lookahead.end - lookahead.start === 2) {
if (lookahead.type === tt._of && !lookahead.containsEsc) {
// `using of` must start a for-lhs-of statement
return false;
} else {
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-parser/src/tokenizer/state.ts
Expand Up @@ -189,4 +189,7 @@ export type LookaheadState = {
curPosition: () => Position;
/* Used only in readToken_mult_modulo */
inType: boolean;
// These boolean properties are not initialized in createLookaheadState()
// instead they will only be set by the tokenizer
containsEsc?: boolean;
};

0 comments on commit 4f0e6ff

Please sign in to comment.