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
{{ message }}
Repository navigation
runtime: a subclass method overriding a native base method (EventEmitter.emit) is silently bypassed — override never runs #6316
A user method that overrides a native base-class method is silently bypassed: the call dispatches straight to the native implementation and the override never runs. super.<method>() from inside such an override also doesn't reach the base.
Confirmed on a clean origin/main build (0960415ad).
The override ran: line is missing — b.emit(...) went directly to the native EventEmitter.emit, skipping the user's method entirely. No error, no warning.
Why it matters
Subclassing EventEmitter and overriding emit/on to add logging, filtering, or instrumentation is an extremely common Node pattern. Today it silently does nothing, which is a wrong answer rather than a crash — the worst failure mode.
Scope
Surfaced while fixing #6301 (class X extends EventTarget inheriting nothing). That issue's fix routes EventTarget methods through the class chain and places them last on the lookup path so a subclass override wins. This issue is the mirror problem for native bases generally: the override is not consulted at all.
Two things to establish:
Which native base classes are affected (EventEmitter confirmed; check EventTarget, Error, Array, Promise, stream classes).
Whether the dispatch bypass and the super.<method>() failure are one root cause or two.
Note super.<method>() into a native base was independently observed as broken during #6301 and scoped out of that PR as orthogonal — this is its tracking issue.
Activity
fix(runtime): a subclass override of a native base method must win ov…
fix(codegen): resolve a native base class by class CHAIN, not by exte…
perf: EventEmitter methods on one shared prototype, node's _events store