Files
node/test/ffi
Trivikram Kamat 1eb734d568 ffi: drain task queues after event loop callbacks
When native code invokes a registered callback from the event loop,
no callback scope is active. A nextTick or microtask queued by the
callback only ran when an unrelated Node.js callback fired, or at
beforeExit.

Open an InternalCallbackScope in InvokeCallback when no scope is
active, so the queues are drained when the callback returns.
Callbacks invoked synchronously during a call into native code
already run inside the caller's scope and are left unchanged.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66918
Fixes: https://github.com/nodejs/node/issues/66917
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-10-24 03:55:50 +00:00
..
2026-10-15 07:53:03 +00:00