Skip to content

Track remaining node:timers parity gaps #1213

Description

@TheHypnoo

Summary

Follow-up for the granular node:timers parity work: the current timers suite covers the passing deterministic surface, but a few deeper Node parity gaps should be implemented before adding their corresponding fixtures.

Remaining gaps

  1. Numeric timer clears

    • clearTimeout(+timeout) should clear a timeout handle by its primitive numeric id.
    • clearInterval(+interval) should clear an interval handle by its primitive numeric id.
    • Related cross-clear shapes should also be validated once numeric clears work.
  2. Timer callback this binding

    • Node invokes setTimeout / setInterval callbacks with this bound to the Timeout object.
    • Perry currently executes timer callbacks without exposing that Timeout-shaped receiver.
  3. Full node:timers import surface

    • Add parity for namespace/default imports:
      • import * as timers from "node:timers"
      • import timers from "node:timers"
      • prefixless timers namespace/default imports
    • Ensure function identity and callable namespace properties match Node where practical.
  4. Deeper node:timers/promises semantics

    • setTimeout(ms, value) should resolve with value.
    • setImmediate(value) should resolve with value.
    • setInterval(ms, value) should behave as an async iterator yielding value.
    • AbortSignal/options coverage should be added after the value and iterator paths are stable.

Acceptance criteria

  • Add focused TypeScript fixtures under test-parity/node-suite/timers for each fixed behavior.
  • Keep ./run_parity_tests.sh --suite node-suite --module timers at 100% without adding new known_failures entries.
  • Prefer small runtime fixes in the same PR as the fixtures when practical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    parityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions