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: due/now Math.max instead of min #3477

Conversation

kevinkassimo
Copy link
Contributor

@kevinkassimo kevinkassimo commented Dec 9, 2019

... which results in the following line failing (as there might be chances when now is slightly larger than due):

deno/cli/js/timers.ts

Lines 43 to 44 in 90c5aad

const timeout = due - now;
assert(timeout >= 0);

Instead we should always make due >= now, and set due to now if due is in the past already

Copy link
Member

@piscisaureus piscisaureus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally makes sense! Thanks for catching this.

@piscisaureus piscisaureus merged commit ec7f3ce into denoland:master Dec 10, 2019
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
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.

2 participants