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

🐛 Values returned by setInterval must be greater than 0. #27323

Merged
merged 1 commit into from Mar 24, 2020

Conversation

mgriego
Copy link
Contributor

@mgriego mgriego commented Mar 19, 2020

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps

Per the spec, timers must return a value greater than 0. Currently, the first setInterval call will return 0 as the interval ID. This can cause some code to inadvertently fail, since 0 is falsey.

@amp-owners-bot amp-owners-bot bot requested a review from JonEleven March 19, 2020 22:11
@mgriego mgriego changed the title 🐛 Values returned by setTimeout and setInterval must be greater than 0. 🐛 Values returned by setInterval must be greater than 0. Mar 20, 2020
@mgriego
Copy link
Contributor Author

mgriego commented Mar 20, 2020

@powerivq

@kristoferbaxter kristoferbaxter requested review from powerivq and removed request for JonEleven March 24, 2020 18:21
@powerivq powerivq merged commit 373acbc into ampproject:master Mar 24, 2020
@mgriego mgriego deleted the fix-interval-ids branch March 24, 2020 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants