Skip to content

events, timers: NodeEventTarget dispatch and Timeout.close() - #3535

Open
ctate wants to merge 2 commits into
mainfrom
ctate/events-timers-nodeeventtarget-27e083
Open

ctate wants to merge 2 commits into
mainfrom
ctate/events-timers-nodeeventtarget-27e083

Conversation

@ctate

@ctate ctate commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator
  • Move NodeEventTarget, its NodeEventTarget vs. EventEmitter note, and its eleven documented listener methods from not-implemented to partial, with a Worker/MessagePort differential program (13 rows).
  • Move timeout.close() to supported and pin the timer handle's Symbol.toPrimitive and Symbol.dispose spellings with a timer corpus program (1 row status move, 3 rows of added evidence).

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Nov 11, 2026 4:55am UTC

"timers.clearTimeout": { argTypes: [F64], result: VOID },
/** Timeout.close() — clearTimeout(this) that returns the handle for
* chaining. Node's legacy cancel; mock-aware like clearTimeout. */
"timers.close": { argTypes: [F64], result: F64 },

@vercel vercel Bot Nov 11, 2026 •

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 timers.close, event.onceTarget and event.onceTargetSignal builtins have no throw classifications, causing the existing “every builtin says whether it can throw” test to reject them.

Fix on Vercel

"timers.setTimeoutHandle": "scr_test_mt_set_timeout_handle",
"timers.setInterval": "scr_test_mt_set_interval",
"timers.clearTimeout": "scr_test_mt_clear_timeout",
"timers.close": "scr_test_mt_clear_timeout",

@vercel vercel Bot Nov 11, 2026 •

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.

When only setInterval is mocked, Timeout.close() calls the timeout-specific clearer and leaves the mocked interval queued, so it continues firing after cancellation.

Fix on Vercel

Comment on lines +254 to +255
scr_emitter_mark_plain(view->events);
scr_worker_seed_meta_listeners(view->events);

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.

Applying NodeEventTarget semantics to Worker suppresses its listener meta-events and duplicate registrations, although Node Workers inherit EventEmitter rather than NodeEventTarget.

Fix on Vercel

This branch was successfully deployed

1 active deployment
Preview — 71d27e1e Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant