async function resolution order
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: johnplaisted, Assigned: jorendorff)
References
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Steps to reproduce:
The await keyword has a different resolution order than Promises, which seems incorrect (and fwiw Chrome's await matches promises; Safari appears to share FireFox's behavior).
I think I've found two different cases where the order is different from promises:
- In some cases the await order determines when functions continue (rather than the resolve() order, assuming things resolve synchronously)
- In some other cases it seems to be the opposite of the resolve AND await order when the are the same order. Maybe it is because one is an
await <literal>and the other is anawait promise?
Tested on FireFox 66.
Actual results:
The order of asynchronous code with an async function doesn't match the equivalent promise code.
When running the file:
- async test fails
- promise test passes
- order of await determines order of async callbacks
- order resolve() determines order of promise callbacks
Expected results:
The async function order matches the Promise equivalent.
When running the file:
- async test passes
- promise test passes
- order of resolve() determines order of async callbacks
- order resolve() determines order of promise callbacks
| Reporter | ||
Comment 1•7 years ago
|
||
I filed a webkit bug as well
Comment 2•7 years ago
|
||
Using the test case above, I confirm this issue occurs in Beta v68.0b14 and Release v67.0.4, but DOE NOT occur in Nightly v69.0a1 (2019-07-02) on MacBook Pro with Mac OS 10.14.5.
Setting bug's component as (Core) JavaScript Engine.
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Comment 4•7 years ago
|
||
(In reply to Bodea Daniel [:danibodea] from comment #2)
Using the test case above, I confirm this issue occurs in Beta v68.0b14 and Release v67.0.4, but DOE NOT occur in Nightly v69.0a1 (2019-07-02) on MacBook Pro with Mac OS 10.14.5.
Setting bug's component as (Core) JavaScript Engine.
Can you please bisect what fixed this?
Comment 5•7 years ago
|
||
Unfortunately, there were insufficient builds to bisect the fix completely, but these are the logs. Hope it helps.
Comment 6•7 years ago
|
||
Bug 1546145 stands out as a likely candidate in that range. I don't think that's a fix we could safely consider backporting, however, so this may just need to ride out with 69.
Comment 7•7 years ago
|
||
Yes, the difference is caused by the spec change implemented in bug 1495072 (and enabled by default in bug 1546145).
Comment 8•7 years ago
|
||
Thanks, calling this fixed by those two bugs then. But yeah, that's definitely not a change we can realistically consider backporting to stable branches, so 69+ it is.
| Reporter | ||
Comment 9•7 years ago
|
||
Thanks!
Description
•