Skip to content

class X extends AsyncLocalStorage has the same indirect-heritage defect as #10453, blocked on perry-runtime not being able to reach perry-stdlib's init helper #10625

Description

@proggeramlug

PR #10621 fixed class X extends AsyncResource for every syntax that reaches the value indirectly (local alias,
namespace member, CJS destructured require()) by generalizing bound_native_callable_module_and_method in
crates/perry-runtime/src/object/global_this/fetch_globals.rs to recognize ("async_hooks", "AsyncResource")
and route to js_async_resource_subclass_init.

AsyncLocalStorage has the same defect shape and was deliberately left unfixed, for a structural reason: its
init helper lives in perry-stdlib, and perry-runtime cannot depend on perry-stdlib. So the same one-line
recognition arm is not available without either moving the helper down into perry-runtime or introducing an
indirection (a registration hook the stdlib installs at startup, which is how other cross-crate surfaces are
wired).

Deciding which of those two shapes is right is the actual work here; the detection half is already solved and
can be copied from #10621's diff.

Note AsyncLocalStorage is not a stub — real tracking across await/microtasks/timers landed in #788 — so this
is about subclassing it, not about its behaviour.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package-auditFound by the 2026 package audit: compiling real npm packages from source instead of native bindings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions