Skip to content

class X extends EventEmitterAsyncResource {}: instance is correct but 'x instanceof EventEmitterAsyncResource' is false #10638

Description

@proggeramlug

Found while fixing #10623 (PR #10636). Reproduces on clean main and is unrelated to that PR — this is a plain
ESM import with no require()/CJS wrapper involved, and #10636 touches only heritage resolution during
lowering, not the instanceof runtime check.

import { EventEmitterAsyncResource } from "node:events";
class NoCtorEEAR extends EventEmitterAsyncResource {}
const e = new NoCtorEEAR();
console.log(typeof e.on, typeof e.triggerAsyncId, e instanceof EventEmitterAsyncResource);

Node: function number true
Perry: function number false

Note the instance is otherwise correct — on and triggerAsyncId are both present and of the right type. Only
the instanceof check disagrees.

Relationship to other open work — needs checking, not assumed

AsyncLocalStorage was initially reported as having the same gap; that was wrong and has been retracted — it
returns true on both Node and Perry.

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