Skip to content

Fix await using expression printing using as await - #31324

Merged
Jarred-Sumner merged 3 commits into
mainfrom
farm/b916b682/fix-await-using-expr
May 24, 2026
Merged

Fix await using expression printing using as await#31324
Jarred-Sumner merged 3 commits into
mainfrom
farm/b916b682/fix-await-using-expr

Fix `await using` expression printing `using` as `await`

fe6c1c9
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 24, 2026 in 33m 8s

Code review found 1 potential issue

Found 2 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/js_parser/parse/mod.rs:919-922 Missing [no LineTerminator here] check between 'await' and 'using'

Annotations

Check notice on line 922 in src/js_parser/parse/mod.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Missing [no LineTerminator here] check between 'await' and 'using'

Pre-existing (not introduced here, and matches esbuild/TS): the entry condition at line 885 doesn't check `!p.lexer.has_newline_before`, so `await\nusing x = y` is accepted as an `await using` declaration. Per the spec's `AwaitUsingDeclarationHead : await [no LineTerminator here] using` refinement + must-cover early error this should be a **SyntaxError** (V8 rejects it). Since you're already in this block, an optional follow-up would be adding `&& !p.lexer.has_newline_before` at line 885 — but i