Closed
Bug 1104064
Opened 9 years ago
Closed 9 years ago
setInterval(,0) only fires once in worker
Categories
(Core :: DOM: Workers, defect)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: bkelly, Assigned: baku)
References
Details
Attachments
(1 file)
1.83 KB,
patch
|
khuey
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Open the web console and run the following: var workerScript = 'data:text/javascript, setInterval(function() { console.log(Math.random()); }, 0)'; var worker = new Worker(workerScript); You will only see a single log statement. This should repeatedly log. In contrast, this works: var workerScript = 'data:text/javascript, function f() { console.log(Math.random()); setTimeout(f, 0); } f();'; var worker = new Worker(workerScript);
I suspect this is limited to setInterval(,0). 10ms seems to work.
Reporter | ||
Comment 2•9 years ago
|
||
Interesting that it doesn't latch at a minimum value. I thought that was how main thread setInterval() worked.
Reporter | ||
Updated•9 years ago
|
Summary: setInterval() only fires once in worker → setInterval(,0) only fires once in worker
Assignee | ||
Comment 3•9 years ago
|
||
Also 1ms works. It seems that the issue is just with 0.
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8531639 -
Flags: review?(khuey)
Comment on attachment 8531639 [details] [diff] [review] interval.patch Review of attachment 8531639 [details] [diff] [review]: ----------------------------------------------------------------- Haha. This needs a test.
Attachment #8531639 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 6•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/731184e5ebbd
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → amarchesini
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/731184e5ebbd
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
[Tracking Requested - why for this release]: This is a nasty bug that slipped in some time ago, and the fix is trivial. Let's backport please.
status-firefox34:
--- → affected
status-firefox35:
--- → affected
status-firefox36:
--- → affected
tracking-firefox36:
--- → ?
tracking-firefox35:
--- → ?
Comment 9•9 years ago
|
||
Andrea, could you request an uplift to aurora & beta?
status-firefox37:
--- → affected
Flags: needinfo?(amarchesini)
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8531639 [details] [diff] [review] interval.patch Approval Request Comment [Feature/regressing bug #]: bug 928312 [User impact if declined]: setInterval can be broken if used with timer 0 [Describe test coverage new/current, TBPL]: tbpl [Risks and why]: none [String/UUID change made/needed]: none
Flags: needinfo?(amarchesini)
Attachment #8531639 -
Flags: approval-mozilla-beta?
Attachment #8531639 -
Flags: approval-mozilla-aurora?
Updated•9 years ago
|
Updated•9 years ago
|
Attachment #8531639 -
Flags: approval-mozilla-beta?
Attachment #8531639 -
Flags: approval-mozilla-beta+
Attachment #8531639 -
Flags: approval-mozilla-aurora?
Attachment #8531639 -
Flags: approval-mozilla-aurora+
Comment 11•9 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/84e8d92b74c7 https://hg.mozilla.org/releases/mozilla-beta/rev/084a4d8ad42b
You need to log in
before you can comment on or make changes to this bug.
Description
•