Closed
Bug 1469325
Opened 7 years ago
Closed 7 years ago
`dom.promise_rejection_events.enabled` not honored
Categories
(Developer Documentation Graveyard :: API: DOM, defect)
Developer Documentation Graveyard
API: DOM
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jugglinmike, Unassigned)
Details
Operating System: GNU/Linux, Ubuntu 16.04
Browser release: Firefox Nightly
Browser version: 62.0a1 (2018-06-18) (64-bit)
Steps to reproduce:
1. Visit `about:config`
2. Search for string "promise"
3. Set `dom.promise_rejection_events.enabled` preference to `true`
4. Close the browser
5. Create a document with the following source code:
<meta charset="utf-8">
<script>
window.addEventListener('unhandledrejection', function() {
console.log('unhandledrejection listener');
});
Promise.reject(new Error('intentionally unhandled'));
</script>
6. Open the document in a new browser instance
Expected: the text "unhandledrejection listener" should be printed to the
developer console
Actual: the text "Error: intentionally unhandled" is printed to the developer
console
The actual behavior is a browser-generated message which may be appropriate
even when the event listener is honored (for example, Chromium invokes the
handler and prints an error message).
The MDN page for the `unhandledrejection` event [1] states:
> In Firefox, this is implemented but disabled by default. To turn it on, go to
> about:config and set the `dom.promise_rejection_events.enabled` pref to
> `true`.
[1] https://developer.mozilla.org/en-US/docs/Web/Events/unhandledrejection
Comment 1•7 years ago
|
||
I'm not familiar with this, but reading bug 1362272 it sounds like the implementation wasn't completed. Maybe this should be duped to that bug? The person who was working on it is listed as "inactive" in bugzilla.
Comment 2•7 years ago
|
||
Yeah, this stuff is basically in a very preliminary state; that's why it's disabled so far.
In particular, the only thing the pref controls is whether the PromiseRejectionEvent interface is exposed on the global. Actual firing of such events is not implemented yet.
So the MDN page is ... not quite right.
Comment 3•7 years ago
|
||
I just deleted the note on the MDN page rather than explaining the subtleties, since the current state doesn't seem useful for devs to know about.
| Reporter | ||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox62:
affected → ---
Component: DOM: Events → API: DOM
Product: Core → Developer Documentation
Resolution: --- → FIXED
Version: 62 Branch → unspecified
| Reporter | ||
Comment 4•7 years ago
|
||
Cool, that was my plan as well. Given the availability of bug 1362272, I've re-labeled this as a documentation bug, now resolved. Thanks, all.
You need to log in
before you can comment on or make changes to this bug.
Description
•