Closed Bug 1195336 Opened 9 years ago Closed 8 years ago

setTimeout callback called before promise callback

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox40 --- affected
firefox41 --- affected
firefox42 --- unaffected
firefox43 --- unaffected

People

(Reporter: jaffathecake, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36

Steps to reproduce:

http://jsbin.com/yokugu/edit?js,console


Actual results:

`setTimeout` is logged before `promise1`.


Expected results:

Microtasks (promise callbacks) should execute before additional tasks (setTimeout).

Firefox 39 did the right thing, but 40 appears to have regressed.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Product: Firefox → Core
I tested this in nightly 43 and dev edition 42 and it does not reproduce any more.  It does seem to effect 40 and 41, though.
Ah, really sorry, I could have sworn I saw it failing in nightly, but I think I've been staring at these tests too long. Happy for this to close.
Well, if we can find the bug that fixed this, maybe we could uplift it to beta 41 before the next merge.
Blocks: 1193394
I ran:

mozregression --find-fix --bad-release 40 --arg="https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/"

…but it didn't give me a "bad" version. I guess I'm using it wrong, unless the bug somehow doesn't happen in nightlies, but hit the release.
Bug 1179909 fiddled with event loops and Promises, but that landed in Nightly 43 after 42 branched.
> Well, if we can find the bug that fixed this

I was going to guess bug 1162013, but that landed in 40...

Also, I can't reproduce this in 40 or 41 or 39, though at least in 39 I can describe how it _could_ happen (see bug 1162013).
The affected versions are long gone, closing.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.