Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer.restart calls sleep without argument #46

Closed
urbanhop opened this issue Jul 18, 2016 · 1 comment
Closed

Timer.restart calls sleep without argument #46

urbanhop opened this issue Jul 18, 2016 · 1 comment

Comments

@urbanhop
Copy link

restart calls sleep() without argument - not sure this is intended.

Timer.prototype = timer.prototype = {
    constructor: Timer,
    restart: function(callback, delay, time) {
      if (typeof callback !== "function") throw new TypeError("callback is not a function");
      time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
      if (!this._next && taskTail !== this) {
        if (taskTail) taskTail._next = this;
        else taskHead = this;
        taskTail = this;
      }
      this._call = callback;
      this._time = time;
      sleep(); // <<<<<<<<<<<<<<<<<<<<<<<<<< sleep(this._time) ????
    },
@mbostock
Copy link
Member

This is intentional. It means to sleep for the smallest possible amount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants