List own property names for uncaught non-Error exception objects instead of bare "Object"
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
(Blocks 3 open bugs)
Details
Attachments
(3 files)
When a non-Error value (a plain object, or a promise rejected with one) reaches the error reporter in NoSideEffects mode — unhandled promise rejections, window.onerror, worker errors — the console shows the unhelpful "uncaught exception: Object".
This lists the object's own string-keyed data property names, e.g. "uncaught exception: Object (code, message)", without running user code (no getters/proxy traps; cross-origin wrappers stay opaque). Adds a jsapi-test
| Assignee | ||
Comment 1•2 months ago
|
||
Updated•2 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
| Assignee | ||
Comment 3•1 month ago
|
||
Test case:
<!DOCTYPE html>
<meta charset="utf-8">
<title>bug 2056615</title>
<script>
// Unhandled rejection with a non-Error object -> Promise::ReportRejectedPromise
Promise.reject({ code: 42, message: "nope" });
// no own data properties -> falls back to bare "Object"
Promise.reject({});
// getter only -> not listed, no user code run
Promise.reject({ get reason() { return "boom"; } });
// plain throw still uses NoSideEffects (window.onerror path), unchanged
setTimeout(() => { throw { thrown: 1 }; }, 0);
</script>
Comment 5•1 month ago
|
||
| bugherder | ||
Comment 6•1 month ago
|
||
Did you want to nominate this for the Fx155 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Possible wording:
Uncaught non-Error exceptions now list their property names in the Console instead of showing only "Object".
| Assignee | ||
Comment 7•1 month ago
|
||
Maybe? Matthew, wdyt ? :)
Comment 8•1 month ago
|
||
I don't think this is a relnote feature, as happy as I am for this to have landed?
Comment 9•1 month ago
•
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Nicer to deal with errors for web developers
[Affects Firefox for Android]: Probably
[Suggested wording]: "Rejected objects are viewable in devtools" ??
[Links (documentation, blog post, etc)]:
Oh. Ok, re-reading this affects content mode; so will flag for relnote.
Updated•1 month ago
|
Description
•