Implement notifying of rejected promises (PromiseRejectionEvent)
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: ben.tian, Assigned: edgar)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete)
Attachments
(2 files, 1 obsolete file)
This bug is to 1) implement notifying of rejected promises per HTML spec [1] and fire PromiseRejectionEvent [2], and 2) enable PromiseRejectionEvent interface implemented in bug 1338059. Note bug 1338059 implements PromiseRejectionEvent interface but disables it until we actually fire the events. [1] Section 8.1.3.12 Unhandled promise rejections https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections [2] https://html.spec.whatwg.org/multipage/webappapis.html#promiserejectionevent
Comment 3•6 years ago
|
||
Added DDN keyword for tracking for doc purposes. Also added "PromiseRejectionEvent" to the summary to help make this bug easier to find using a quick search.
Comment 4•6 years ago
|
||
ni? :overholt to prioritize this given the new information we have on usage.
Reporter | ||
Updated•6 years ago
|
Comment 6•5 years ago
|
||
Note that this could cause bogus successes in tests, given testharness.js (by default) is meant to fail if there's unhandled rejections.
Comment 7•5 years ago
|
||
unhandledrejection lands in Servo at https://github.com/servo/servo/pull/20755
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 12•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #10)
Created attachment 9040755 [details]
Bug 1362272 - Part 3: Enable on nightly and update tests;
I am going to do this in a separated bug.
Updated•5 years ago
|
Comment 13•4 years ago
|
||
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9ccbfb3293c Part 1: Add onrejectionhandled and onunhandledrejection EventHandler; r=smaug https://hg.mozilla.org/integration/autoland/rev/d7eaeddfd71d Part 2: Implement notifying of rejected promises; r=smaug
Comment 14•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a9ccbfb3293c
https://hg.mozilla.org/mozilla-central/rev/d7eaeddfd71d
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16869 for changes under testing/web-platform/tests
Upstream PR merged
Comment 17•4 years ago
•
|
||
This was already mostly documented, but I've polished things up and done the rest of the remaining bits:
- Cleaned up and improved PromiseRejectionEvent
- JavaScript Guide section Promise rejection events already exists
- All other related content reviewed and looks good.
- Added to Firefox 69 for developers
- Submitted BCD PR 44386 with changes needed there
Comment 18•4 years ago
|
||
:sheppy and others, are you sure Firefox 68 is or will be correct and not 69?
Via https://github.com/Fyrd/caniuse/pull/4972 and https://tests.caniuse.com/?feat=unhandledrejection leading to the comparison: https://i.imgur.com/2Iphqre.png
Comment 19•4 years ago
|
||
(In reply to kai.hollberg from comment #18)
:sheppy and others, are you sure Firefox 68 is or will be correct and not 69?
Via https://github.com/Fyrd/caniuse/pull/4972 and https://tests.caniuse.com/?feat=unhandledrejection leading to the comparison: https://i.imgur.com/2Iphqre.png
The implementation landed in 68 in this bug. We enabled it from 69 in bug 1525554 instead.
Comment 20•4 years ago
|
||
This bug is Resolved, yet I have encountered a failure of Firefox to send both the rejectionhandled and onunhandledrejection events, in accordance with its own documentation (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises, https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent). When I omit a "catch()" for a Promise that Rejects, the Web Console reports that an unhandled exception occurred. There seems to be no way to report this programming error to the user, since try/catch fails, probably due to Promise having its own try/catch. I am using the latest public Firefox, 68.0.2. (This problem is not urgent for me, I just don't think it is right that the documentation and functionality are not kept in sync with each other.)
Comment 21•4 years ago
|
||
Perhaps the Mozilla documentation (site:developer.mozilla.org/en-US/docs) is not included in github? It should be, so it can be synchronized with function and bug releases.
Comment 24•4 years ago
|
||
If there is no current reason to keep this feature as enabled only in about:config, my vote would be to complete and release these window event notifications for real so they will alert developers to missing catch() functions or missing try/catch in their Promise or Await chains.
Assignee | ||
Comment 25•4 years ago
|
||
(In reply to David Spector from comment #24)
If there is no current reason to keep this feature as enabled only in about:config, my vote would be to complete and release these window event notifications for real so they will alert developers to missing catch() functions or missing try/catch in their Promise or Await chains.
Hi David, this feature is enabled by default in bug 1525554, it should be available after 69 release. Thanks.
Description
•