Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8141b01
node:child_process: keep an IPC message that arrives before there is …
dylan-conway Oct 17, 2026
dd3283d
node:child_process: emit held IPC messages in one tick in the parent …
dylan-conway Oct 17, 2026
31474d6
Held IPC messages are emitted as in Node where a listener throws: the…
dylan-conway Oct 18, 2026
07f946e
Import bunEnv in the IPC test
dylan-conway Oct 18, 2026
2a7ae47
In a child the held IPC messages are emitted from a real 'newListener…
dylan-conway Oct 18, 2026
647f0c7
process.emit() throws what a listener throws as in Node, and IPC mess…
dylan-conway Oct 18, 2026
d1fa042
Remove a test that belongs to another change
dylan-conway Oct 18, 2026
3b17139
In a child the IPC code asks the listenerCount() that JavaScript sees…
dylan-conway Oct 18, 2026
8000854
process.emit() is main's again, the parent's code for held messages i…
dylan-conway Oct 18, 2026
3c32b31
With no 'message' listener a child asks the listenerCount() that Java…
dylan-conway Oct 18, 2026
ff0ac4c
The child's 'newListener' listener for held IPC messages is native, s…
dylan-conway Oct 18, 2026
5889eb8
The parent's tick for held IPC messages tests the channel, as in Node
dylan-conway Oct 18, 2026
a01f1c4
Test that on() at the stack limit throws to its caller while IPC mess…
dylan-conway Oct 18, 2026
3654a5a
Kept IPC messages are not emitted after an exception nobody handles o…
dylan-conway Oct 18, 2026
14e38d2
The owner of an IPC channel hears of the peer's EOF in the loop itera…
dylan-conway Oct 18, 2026
e1edd65
A tick queued in a dns, dgram, inspector, fs.watch or child stdio cal…
dylan-conway Oct 18, 2026
1158d52
A kept IPC message builds the tick queue in a preload too
dylan-conway Oct 18, 2026
804af16
Take the callback order changes in dns, dgram, inspector, fs.watch an…
dylan-conway Oct 18, 2026
4e0ae84
The owner of an IPC channel hears of a reset by the peer in the loop …
dylan-conway Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/js/node/child_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ class ChildProcess extends EventEmitter {
#handle;
#closesNeeded = 1;
#closesGot = 0;
#pendingMessages;
Comment thread
claude[bot] marked this conversation as resolved.
Resolved

declare send?: (message, handle?, options?, callback?) => boolean;
declare disconnect?: () => void;
Expand Down Expand Up @@ -1512,6 +1513,10 @@ class ChildProcess extends EventEmitter {
this.send = this.#send;
this.disconnect = this.#disconnect;
this.channel = new Control();
this.#pendingMessages = [];
this.on("newListener", () => {
process.nextTick(() => this.#emitPendingMessages());
});
Object.defineProperty(this, "_channel", {
get() {
return this.channel;
Expand Down Expand Up @@ -1563,8 +1568,20 @@ class ChildProcess extends EventEmitter {
}
}

// https://github.com/nodejs/node/blob/v26.3.0/lib/internal/child_process.js#L954-L964
#emitIpcMessage(message, _, handle) {
this.emit(isInternalIpcMessage(message) ? "internalMessage" : "message", message, handle);
if (isInternalIpcMessage(message)) this.emit("internalMessage", message, handle);
else if (this.listenerCount("message")) this.emit("message", message, handle);
else ArrayPrototypePush.$call(this.#pendingMessages, [message, handle]);
}

// https://github.com/nodejs/node/blob/v26.3.0/lib/internal/child_process.js#L726-L742
#emitPendingMessages() {
if (!this.connected || !this.listenerCount("message")) return;
const messages = this.#pendingMessages;
const { length } = messages;
for (let i = 0; i < length; i++) this.emit("message", messages[i][0], messages[i][1]);
this.#pendingMessages = [];
}

#send(message, handle, options, callback) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Expand Down Expand Up @@ -1618,6 +1635,7 @@ class ChildProcess extends EventEmitter {
return;
}
$assert(!this.connected);
this.#pendingMessages = [];
process.nextTick(() => this.emit("disconnect"));
process.nextTick(() => this.#maybeClose());
}
Expand Down
67 changes: 67 additions & 0 deletions src/jsc/bindings/BunProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,54 @@ extern "C" void Bun__installWatchModeSignalHandler(int signalNumber)
extern "C" void Bun__MemoryPressure__install(JSC::JSGlobalObject* global);
extern "C" void Bun__MemoryPressure__uninstall(JSC::JSGlobalObject* global);

// https://github.com/nodejs/node/blob/v26.3.0/lib/internal/child_process.js#L726-L742
JSC_DEFINE_HOST_FUNCTION(Process_functionEmitPendingMessages, (JSGlobalObject * lexicalGlobalObject, CallFrame*))
{
auto* global = defaultGlobalObject(lexicalGlobalObject);
auto& vm = JSC::getVM(global);
auto scope = DECLARE_THROW_SCOPE(vm);
auto* process = global->processObject();
auto* pending = process->m_pendingMessages.get();
if (!pending || !Bun__GlobalObject__connectedIPC(global) || !process->wrapped().hasEventListeners(vm.propertyNames->message))
return JSValue::encode(jsUndefined());

for (unsigned i = 0, length = pending->length(); i < length; i += 2) {
JSC::MarkedArgumentBuffer args;
args.append(pending->getIndex(global, i));
RETURN_IF_EXCEPTION(scope, {});
args.append(pending->getIndex(global, i + 1));
RETURN_IF_EXCEPTION(scope, {});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟣 pre-existing, not blocking: pre-existing: a child that monkey-patches process.emit or process.listenerCount (signal-exit, warning filters, instrumentation) never sees replayed IPC 'message' events, unlike Node. Process_functionEmitPendingMessages at src/jsc/bindings/BunProcess.cpp:1605 calls the native wrapped().emit and at :1597 the native hasEventListeners, bypassing the JS-visible methods, and the live path at :5024-5028 does the same. Fix: route both the pending-replay and live delivery through the JS-visible process.emit and process.listenerCount (as the PR text says callProcessMethod does), so an override observes every 'message' the way Node's target.emit()/target.listenerCount() do. Same pattern at 2 sites (BunProcess.cpp:1597-1605, BunProcess.cpp:5024-5028).
A small fix can ride a push you are already making; otherwise a short reply is enough.

Why this was flagged

A Bun IPC child does const orig = process.emit; process.emit = function (name, ...a) { log(name); return orig.apply(this, [name, ...a]); } (the signal-exit / warning-filter pattern) and later adds a 'message' listener after messages were buffered. Process_functionEmitPendingMessages at src/jsc/bindings/BunProcess.cpp:1605 replays them with process->wrapped().emit(vm.propertyNames->message, args, &listenerThrew), the C++ EventEmitter path, so the override is never called; the guard at :1597 likewise uses hasEventListeners rather than the JS-visible listenerCount, so a replaced listenerCount is ignored. Node's lib/internal/child_process.js newListener handler calls target.emit and target.listenerCount, which are the overridable JS methods, so the override logs 'message' there. The live path at :5024-5028 has the same bypass on the base branch, so for live messages this is pre-existing; for buffered messages the base dropped them entirely.

Verification: pre-existing — the live delivery path at base already bypasses a user override of process.emit by the same route. In src/jsc/bindings/BunProcess.cpp Process_functionEmitPendingMessages guards with the native process->wrapped().hasEventListeners(vm.propertyNames->message) (line 1597) and replays with process->wrapped().emit(vm.propertyNames->message, args, &listenerThrew) (line 1607).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new hasMessageListener() covers the listenerCount half, but both delivery sites still go through the native emitter: Process_functionEmitPendingMessages replays with process->wrapped().emit(vm.propertyNames->message, args, &listenerThrew) and emitOrHoldMessage delivers live messages with process->wrapped().emit(vm.propertyNames->message, args). EventEmitter::emit is fireEventListeners on the C++ listener map, so a child that replaced process.emit (the signal-exit / warning-filter pattern) still never observes 'message', unlike Node's target.emit(). To close this, look up process.emit via process->get(...) and JSC::call it with (message, data, handle) as Process_functionEmitHelper already does, keeping RETURN_IF_EXCEPTION in place of the listenerThrew flag so the replay loop still stops at the first throwing listener.

bool listenerThrew = false;
process->wrapped().emit(vm.propertyNames->message, args, &listenerThrew);
// In Node the exception leaves the loop, and the next listener gets all of them again.
if (listenerThrew)
return JSValue::encode(jsUndefined());
}
process->m_pendingMessages.clear();
return JSValue::encode(jsUndefined());
}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
JSC_DEFINE_HOST_FUNCTION(Process_functionOnNewListener, (JSGlobalObject * lexicalGlobalObject, CallFrame*))
{
auto* global = defaultGlobalObject(lexicalGlobalObject);
auto* process = global->processObject();
if (process->m_pendingMessages)
process->queueNextTick(global, JSFunction::create(JSC::getVM(global), global, 0, ""_s, Process_functionEmitPendingMessages, ImplementationVisibility::Private));
return JSValue::encode(jsUndefined());
Comment on lines +1646 to +1649

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 nit (optional): maintainers get a host function that can leave a pending JS exception while returning a value, which the repo's exception-check rule forbids. Process_functionOnNewListener at src/jsc/bindings/BunProcess.cpp:1645 calls queueNextTick, which runs process.nextTick (user JS) and can throw, then returns jsUndefined() at :1646 with no throw scope or exception check. Fix: declare a throw scope at the top, and after queueNextTick use RETURN_IF_EXCEPTION(scope, {}) (or RELEASE_AND_RETURN) as the sibling host functions in this file do, so a throwing nextTick propagates as an empty return.

Why this was flagged

The 'newListener' listener installed by installPendingMessagesListener (src/jsc/bindings/BunProcess.cpp:1650-1659) fires Process_functionOnNewListener on every process.on()/once() in an IPC child. It calls global->processObject()->queueNextTick(...) at BunProcess.cpp:1645; queueNextTick (BunProcess.cpp:4523-4547) does this->get(globalObject, "nextTick") and JSC::call on the function, both of which can run user JS and throw, and it propagates the exception via RELEASE_AND_RETURN. Process_functionOnNewListener has no DECLARE_THROW_SCOPE and unconditionally returns JSValue::encode(jsUndefined()) at :1646, so a non-empty result is returned while vm has a pending exception. The sibling host functions added in the same change (Process_functionEmitPendingMessages at :1612-1640) check and propagate exceptions. The caller innerInvokeEventListeners catches the pending exception via its NakedPtr call, so this does not crash today; it is a convention slip against the repository rule 'Exception checks after every call that can enter JS'. The base branch has no such function.

Verification: nit. Any process.on()/once() in an IPC child fires the 'newListener' listener, and its queueNextTick call can throw. src/jsc/bindings/BunProcess.cpp:1642-1647 Process_functionOnNewListener calls queueNextTick at :1645 and then returns jsUndefined() at :1646, with no DECLARE_THROW_SCOPE and no RETURN_IF_EXCEPTION. Nothing observable breaks: src/jsc/bindings/webcore/EventEmitter.cpp:259-261 captures the pending exception.

}

// A real listener as in Node's setupChannel: it is counted, and removeAllListeners() takes it away.
void Process::installPendingMessagesListener(JSC::VM& vm)
{
auto* globalObject = defaultGlobalObject(this->globalObject());
if (!Bun__GlobalObject__hasIPC(globalObject))
return;
auto* onNewListener = JSFunction::create(vm, globalObject, 0, ""_s, Process_functionOnNewListener, ImplementationVisibility::Public);
wrapped().addListener(Identifier::fromString(vm, "newListener"_s), WebCore::JSEventListener::create(*onNewListener, *this, false, globalObject->world()), false, false);
vm.writeBarrier(this, onNewListener);
wrapped().setThisObject(this);
}

static void onDidChangeListeners(EventEmitter& eventEmitter, const Identifier& eventName, bool isAdded)
{
if (Bun__isMainThreadVM()) {
Expand Down Expand Up @@ -3782,6 +3830,7 @@ void Process::visitChildrenImpl(JSCell* cell, Visitor& visitor)
visitor.append(thisObject->m_argv);
visitor.append(thisObject->m_execArgv);
visitor.append(thisObject->m_onWarning);
visitor.append(thisObject->m_pendingMessages);

thisObject->m_cpuUsageStructure.visit(visitor);
thisObject->m_resourceUsageStructure.visit(visitor);
Expand Down Expand Up @@ -4957,6 +5006,7 @@ extern "C" void Process__emitMessageEvent(Zig::GlobalObject* global, EncodedJSVa
{
auto* process = global->processObject();
auto& vm = JSC::getVM(global);
auto scope = DECLARE_TOP_EXCEPTION_SCOPE(vm);

auto& names = WebCore::builtinNames(vm);
auto ident = vm.propertyNames->message;
Expand All @@ -4976,13 +5026,29 @@ extern "C" void Process__emitMessageEvent(Zig::GlobalObject* global, EncodedJSVa
args.append(message);
args.append(JSValue::decode(handle));
process->wrapped().emit(ident, args);
} else if (ident == vm.propertyNames->message && Bun__GlobalObject__connectedIPC(global)) {
auto* pending = process->m_pendingMessages.get();
if (!pending) {
pending = JSC::constructEmptyArray(global, nullptr);
if (!scope.exception())
process->m_pendingMessages.set(vm, process, pending);
}
if (!scope.exception())
pending->push(global, message);
if (!scope.exception())
pending->push(global, JSValue::decode(handle));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 (optional) Child processes can get IPC messages paired with the wrong handle after one buffering push fails, which the base never produces since it buffered nothing. In Process__emitMessageEvent the message and its handle are pushed as two separate elements of the flat m_pendingMessages array at src/jsc/bindings/BunProcess.cpp:5037-5039; if the second push throws (OOM, or an Array.prototype indexed setter that throws) the array is left with odd length, so every later pair read by Process_functionEmitPendingMessages at BunProcess.cpp:1600-1604 is shifted by one. Fix: make the two pushes atomic, e.g. push one [message, handle] entry as child_process.ts does, or roll the length back when the handle push throws, so the array can never hold a half pair.

Why this was flagged

A message arrives on the child's IPC channel while there is no 'message' listener, so Process__emitMessageEvent at src/jsc/bindings/BunProcess.cpp:5029 takes the buffering branch. pending->push(global, message) at BunProcess.cpp:5037 succeeds and pending->push(global, JSValue::decode(handle)) at BunProcess.cpp:5039 throws (allocation failure while growing the butterfly, or a throwing indexed setter installed on Array.prototype that puts the array in slow-put mode). The exception is cleared and reported at BunProcess.cpp:5040-5043, but the array now has odd length and is kept. The next message appends [m2, h2], giving [m1, m2, h2]. When a 'message' listener is added, Process_functionEmitPendingMessages at BunProcess.cpp:1600-1604 reads elements i and i+1 as (message, handle), so the listener receives (m1, m2) and then (h2, undefined): wrong handle objects and messages that are never delivered as messages. On the base branch messages without a listener were dropped, so no misdelivery was possible.

Verification: src/jsc/bindings/BunProcess.cpp:5036-5043 appends the message and its handle as two independent elements of the flat array. If :5037 succeeds and :5039 throws, the array is left with odd length. The replay loop at BunProcess.cpp:1600-1610 walks the array in strides of two, so every pair after the failed push is shifted by one. The base cannot produce it because it buffered nothing.

if (auto* exception = scope.exception()) {
CLEAR_IF_EXCEPTION(scope);
Bun__reportUnhandledError(global, JSValue::encode(exception));
}
}
}

extern "C" void Process__emitDisconnectEvent(Zig::GlobalObject* global)
{
auto* process = global->processObject();
auto& vm = JSC::getVM(global);
process->m_pendingMessages.clear();
auto ident = Identifier::fromString(vm, "disconnect"_s);
if (process->wrapped().hasEventListeners(ident)) {
JSC::MarkedArgumentBuffer args;
Expand Down Expand Up @@ -5116,6 +5182,7 @@ void Process::finishCreation(JSC::VM& vm)

// Before the hook below: onDidChangeListeners loads the signal tables on any add.
installDefaultWarningListener(vm);
installPendingMessagesListener(vm);
wrapped().onDidChangeListener = &onDidChangeListeners;

m_cpuUsageStructure.initLater([](const JSC::LazyProperty<Process, JSC::Structure>::Initializer& init) {
Expand Down
3 changes: 3 additions & 0 deletions src/jsc/bindings/BunProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Process : public WebCore::JSEventEmitter {
WriteBarrier<JSObject> m_onWarning;

void installDefaultWarningListener(JSC::VM&);
void installPendingMessagesListener(JSC::VM&);

public:
Process(JSC::Structure* structure, WebCore::JSDOMGlobalObject& globalObject, Ref<WebCore::EventEmitter>&& impl)
Expand All @@ -47,6 +48,8 @@ class Process : public WebCore::JSEventEmitter {

DECLARE_EXPORT_INFO;
bool m_reportOnUncaughtException = false;
// [message, handle, ...] that arrived while 'message' had no listener, like Node's kPendingMessages.
WriteBarrier<JSArray> m_pendingMessages;

static void destroy(JSC::JSCell* cell)
{
Expand Down
14 changes: 9 additions & 5 deletions src/jsc/bindings/webcore/EventEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ bool EventEmitter::emitForBindings(const Identifier& eventType, const MarkedArgu
return emit(eventType, arguments);
}

bool EventEmitter::emit(const Identifier& eventType, const MarkedArgumentBuffer& arguments)
bool EventEmitter::emit(const Identifier& eventType, const MarkedArgumentBuffer& arguments, bool* listenerThrew)
{
return fireEventListeners(eventType, arguments);
return fireEventListeners(eventType, arguments, listenerThrew);
}

Vector<Identifier> EventEmitter::getEventNames()
Expand Down Expand Up @@ -182,7 +182,7 @@ Vector<JSObject*> EventEmitter::getListeners(const Identifier& eventType)
}

// https://dom.spec.whatwg.org/#concept-event-listener-invoke
bool EventEmitter::fireEventListeners(const Identifier& eventType, const MarkedArgumentBuffer& arguments)
bool EventEmitter::fireEventListeners(const Identifier& eventType, const MarkedArgumentBuffer& arguments, bool* listenerThrew)
{

auto* data = eventTargetData();
Expand All @@ -205,15 +205,15 @@ bool EventEmitter::fireEventListeners(const Identifier& eventType, const MarkedA

bool prevFiringEventListeners = data->isFiringEventListeners;
data->isFiringEventListeners = true;
auto fired = innerInvokeEventListeners(eventType, *listenersVector, arguments);
auto fired = innerInvokeEventListeners(eventType, *listenersVector, arguments, listenerThrew);
data->isFiringEventListeners = prevFiringEventListeners;
return fired;
}

// Intentionally creates a copy of the listeners vector to avoid event listeners added after this point from being run.
// Note that removal still has an effect due to the removed field in RegisteredEventListener.
// https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke
bool EventEmitter::innerInvokeEventListeners(const Identifier& eventType, SimpleEventListenerVector listeners, const MarkedArgumentBuffer& arguments)
bool EventEmitter::innerInvokeEventListeners(const Identifier& eventType, SimpleEventListenerVector listeners, const MarkedArgumentBuffer& arguments, bool* listenerThrew)
{
Ref<EventEmitter> protectedThis(*this);
ASSERT(!listeners.isEmpty());
Expand Down Expand Up @@ -275,6 +275,10 @@ bool EventEmitter::innerInvokeEventListeners(const Identifier& eventType, Simple
expcep.append(errorValue);
fireEventListeners(errorIdentifier, WTF::move(expcep));
}
if (listenerThrew) {
*listenerThrew = true;
break;
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/jsc/bindings/webcore/EventEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class EventEmitter final : public ScriptWrappable, public CanMakeWeakPtr<EventEm
WEBCORE_EXPORT bool removeListener(const Identifier& eventType, EventListener&);
WEBCORE_EXPORT bool removeAllListeners(const Identifier& eventType);

WEBCORE_EXPORT bool emit(const Identifier&, const MarkedArgumentBuffer&);
// With `listenerThrew`, the listeners after one that throws are not called, as in Node.
WEBCORE_EXPORT bool emit(const Identifier&, const MarkedArgumentBuffer&, bool* listenerThrew = nullptr);

WEBCORE_EXPORT Vector<Identifier> getEventNames();
WEBCORE_EXPORT Vector<JSObject*> getListeners(const Identifier& eventType);
Expand All @@ -73,7 +74,7 @@ class EventEmitter final : public ScriptWrappable, public CanMakeWeakPtr<EventEm

void setMaxListeners(unsigned count);

bool fireEventListeners(const Identifier& eventName, const MarkedArgumentBuffer& arguments);
bool fireEventListeners(const Identifier& eventName, const MarkedArgumentBuffer& arguments, bool* listenerThrew = nullptr);
bool isFiringEventListeners() const;

const EventEmitterData* eventTargetData() const;
Expand Down Expand Up @@ -102,7 +103,7 @@ class EventEmitter final : public ScriptWrappable, public CanMakeWeakPtr<EventEm
{
}

bool innerInvokeEventListeners(const Identifier&, SimpleEventListenerVector, const MarkedArgumentBuffer& arguments);
bool innerInvokeEventListeners(const Identifier&, SimpleEventListenerVector, const MarkedArgumentBuffer& arguments, bool* listenerThrew);

EventEmitterData m_eventTargetData;
unsigned m_maxListeners { 10 };
Expand Down
30 changes: 28 additions & 2 deletions test/js/node/child_process/child_process_ipc.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { $ } from "bun";
import { bunExe } from "harness";
import { bunEnv, bunExe } from "harness";

test("child_process ipc", async () => {
test.concurrent("child_process ipc", async () => {
const output = await $`${bunExe()} ${import.meta.dir}/fixtures/ipc_fixture.js`.text();
// node (v23.4.0) has identical output
expect(output).toMatchInlineSnapshot(`
Expand All @@ -13,3 +13,29 @@ test("child_process ipc", async () => {
"
`);
});

test.concurrent("a message that arrives before there is a 'message' listener is kept for it", async () => {
const output = await $`${bunExe()} ${import.meta.dir}/fixtures/ipc-pending-messages-fixture.mjs`.env(bunEnv).text();
// node (v26.7.0) has identical output
expect(output).toMatchInlineSnapshot(`
"child, a late listener: ["first","second","end"]
child, a handle: [["first","Server"],"second","end"]
child, a listener that throws: ["first","first","end"]
child, a listener that throws, added before another: ["end"]
child, a listener that throws, then a listener for another event: ["first","first","first","end"]
child, once: ["first","end"]
child, added and removed in one tick: ["first","second","end"]
child, disconnect() in the tick that adds it: []
child, removeAllListeners('newListener'): ["end"]
parent, a late listener: ["first","second","end"]
parent, a handle: [["first","Server"],"second","end"]
parent, a listener that throws: ["first","first","end"]
parent, a listener that throws, added before another: ["end"]
parent, a listener that throws, then a listener for another event: ["first","first","first","end"]
parent, once: ["first","end"]
parent, added and removed in one tick: ["first","second","end"]
parent, disconnect() in the tick that adds it: []
parent, removeAllListeners('newListener'): ["end"]
"
`);
});
Loading
Loading