Files
reverse-engineering-anything/docs/guides
7bedbcb6f6 fix(javascript): scope the missing-listener rule to proven Node emitters (#8663)
* fix(javascript): scope the missing-listener rule to proven Node emitters

A listener method called without a listener argument passes `undefined` to
Node's `checkListener`, which throws before anything is registered or
removed, so no event operation exists. That rule currently applies to every
receiver, including objects that only look like an emitter.

Restrict it to a receiver whose stable initializer is `new EventEmitter()`
resolved through a proven `events` load, or a call Node's own
`child_process` factories answer with a `ChildProcess`. The proof is
withdrawn when `Function.prototype.call` was replaced, when the class
reference or its prototype object escaped to a call, when any member of the
shared `events` module was written, or when the selected method, the
receiver's own prototype or an earlier escape of the instance may have
replaced it. An effect that runs after the call cannot change whether it
threw.

Any other receiver keeps its operation as an unresolved candidate, as it did
before the missing argument was considered. Those include EventEmitter-style
APIs that define a one-argument form, such as Socket.IO's `socket.off("x")`,
which removes every listener for the event.

* fix(javascript): verify native emitter constructor and prototype ownership

* fix(javascript): retain escaped prototype constructor aliases

* fix(javascript): track acquired builtin module mutations

* fix(javascript): charge module acquisition to phase allowance

* fix(javascript): recognize computed builtin getter keys

---------

Co-authored-by: gongfpp <22683417+gongfpp@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-12-01 00:30:59 +08:00
..
…
…