Uncatchable exception setup is a footgun
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | affected |
People
(Reporter: bzbarsky, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [js:tech-debt])
Updated•8 years ago
|
Updated•3 years ago
|
Comment 1•1 year ago
|
||
(In reply to Boris Zbarsky [:bzbarsky] from comment #0)
It might be nice if uncatchable exceptions that are meant to be uncatchable
explicitly set a flag on the JSContext. That is, if "returned false/null
but there is no indication of failure on the JSContext" were considered a
bug in SpiderMonkey APIs.
After bug 1921215, bug 1921780, and bug 1921963, uncatchable exceptions now require a JS::ReportUncatchableException call that sets a flag on the context. A plain return false; without reporting anything will result in an assertion failure in debug builds, if we haven't reported any uncatchable exception before.
The main thing missing still is that the flag is "context has at some point reported an uncatchable exception" and not "context is currently throwing an uncatchable exception", so the tracking is not as precise as it could be. This will still let us catch most bugs though.
For precise tracking we'd have to integrate with the ExceptionStatus enum. Maybe we can keep this bug open for that part.
Description
•