You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Ralph Küpper
committed
fix(async): linearize await inside an async-generator finally; fix aliased native-class new
Lands #8736 and #8738.
#8736 (fixes#8715) closes the `finally` analog of the #8681
`await`-in-`catch` deadlock that #8707 fixed. This is the exact gap
#8707's own new test surfaced when it was rebased -- it reported
"await-in-finally: 2 raw await(s) survived" -- so the two land as a pair.
An `await` inside a `finally` of a real `async function*` compiled to a
blocking busy-wait rather than an async suspend; the linearizer already
splits the finally into its own dispatch states with a
`finally_entry_state`, and the async-step driver now routes through them.
#8738 (fixes#8730) stops an aliased ESM named import of a Node built-in
class throwing `ReferenceError: identifier is not defined` when
constructed at module init -- `import { BlockList as Wj4 } from "net";
new Wj4()` and the same shape for `AsyncLocalStorage` and `PassThrough`.
`lower_new`'s alias-rewrite block rewrites the callee from the local
import name to the class's export name so the construction path matches
the un-aliased form that codegen's builtin-`New` dispatch recognizes.
This broke the natively-compiled Claude Code cli.js 2.1.112 bundle, which
constructs all three at module init, so nearly every command crashed.
No version bump.
Fix an aliased ESM named import of a Node built-in class (`import { BlockList as Wj4 } from "net"`, `{ AsyncLocalStorage as J_z } from "async_hooks"`, `{ PassThrough as Lrz } from "stream"`) throwing `ReferenceError: identifier is not defined` when constructed. The `new`-lowering already rewrites the alias to the class's export name so construction matches the un-aliased form, but the unresolved-`new` guard added in #8688 re-checked the native-module registry under that rewritten export name — which is keyed on the local import name — and, since these classes are not reified global builtins, fired the nameless throw at module init. The guard now also consults the registry under the original imported identifier, so aliased native-class imports resolve and construct exactly like their un-aliased form. This unblocked the natively compiled Claude Code cli.js 2.1.112 bundle, which crashed at module init on nearly every command.
0 commit comments