[wpt-sync] Sync PR 37259 - Web Locks: Throwing a thenable in callback shouldn't invoke it
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 37259 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/37259
Details from upstream follow.
Joshua Bell <jsbell@chromium.org> wrote:
Web Locks: Throwing a thenable in callback shouldn't invoke it
An edge case first reported on github[1] - the result from the lock
acquisition callback should be the resolution of the call's promise.
If the result is itself a promise (or a thenable - i.e. has a then()
method), then it should be "unpacked" per normal promise handling.
This works! Also, if the result is an "abrupt completion" (i.e the
callback throws), that means the resolution should be an exception. So
far, so good! But if that exception is a thenable, it should not be
"unpacked" per normal promise handling. But this is what was happening
in Chrome!The spec is fine here, it was just an implementation bug. Fix the
implementation and add a WPT to cover this case.[1] https://github.com/w3c/web-locks/issues/77
Bug: 1250253
Change-Id: Ib38cd1ff48d5f25e1939f50e614ce623c2d10a35
Reviewed-on: https://chromium-review.googlesource.com/4064307
WPT-Export-Revision: e313f53d669c7aefc47afb13ed7c5ddb06553ba7
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
CI Results
Ran 10 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 4 tests and 11 subtests
Status Summary
Firefox
OK
: 4
PASS
: 44
Chrome
OK
: 4
PASS
: 40
FAIL
: 4
Safari
OK
: 4
PASS
: 44
Links
Comment 4•3 years ago
|
||
bugherder |
Description
•