Skip to content

Remove Symbol.dispose integration in setTimeout and setInterval #58689

Open
@lucacasonato

Description

@lucacasonato

As part of the [Symbol.dispose] integration, the Timeout return type of setTimeout and setInterval support disposing (#48633). This was stabilized last week (#58467).

I think this integration should be removed, as the web platform setTimeout / setInterval do not support Symbol.dispose and never can, because it returns a number.

This means that folks may start writing new code that is incompatible between browser and Node, just because they use the Symbol.dispose integration here. That would be unfortunate.

It would also cause one more incompatibility between server side platforms with web setTimeout, and Node setTimeout (e.g Cloudflare Workers) (cc @jasnell).

@mcollina said in person that this was made stable recently enough to still remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tsc-agendaIssues and PRs to discuss during the meetings of the TSC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions