Skip to content

minor issue with timers.js #2493

Closed
Closed
@getify

Description

@getify

This line:

clearTimeout(timer);

Instead of calling exports.clearTimeout(..), or even better, having a local identifier pointing at that function, this line is making a call that relies on resolving to the identifier on the global object.

That works OK until a lib like mine, stable-timers, comes along and replaces those global timer API methods. When using my lib, I'm getting race conditions where sometimes this line 270 throws an exception that timer._repeat is not a function.

Could we make a small tweak to timers.js to have line 290 reference a reliable internal reference for clearTimeout?

Metadata

Metadata

Assignees

No one assigned

    Labels

    timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions