mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
cfa47ab396
Class static blocks inherit the disabled `in` context of a surrounding `for` initializer, causing valid code such as `for (class { static { a in b; } };;);` to report a missing semicolon at `in`. Enable `Context::In` while parsing the static block, with the existing context helper restoring the surrounding flags afterward.
6 lines
209 B
JavaScript
6 lines
209 B
JavaScript
for (class { static { a in b; } };;);
|
|
for (let C = class { static { a in b; } };;);
|
|
|
|
// Restore the outer initializer's disabled `in` context after the static block.
|
|
for (class { static { a in b; } }.x in c);
|