Skip to content

Commit fcdb0ec

Browse files
fix(javascript): classify yield after a function body without base parser code on the lazy path
The lazy path runs no base prototype method, so it checks the token after a body itself instead of calling `rereadYieldContext`. Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
1 parent 2afea7f commit fcdb0ec

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎lib/javascript/syntax-parser.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13903,7 +13903,10 @@ class WebpackParser extends BaseParser {
1390313903
this._exitedHoisted = undefined;
1390413904
}
1390513905
this.exitScope();
13906-
this.rereadYieldContext();
13906+
// the lazy path runs no base prototype code: `rereadYieldContext` inlined
13907+
if (this.type === tokTypes.name && this.value === "yield") {
13908+
this.exprAllowed = this.inGeneratorContext();
13909+
}
1390713910
}
1390813911

1390913912
/**

0 commit comments

Comments
 (0)