Closed
Bug 433618
Opened 17 years ago
Closed 4 years ago
JS_GetPendingException doesn't return objects other than Error
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: taras.mozilla, Unassigned)
Details
Attachments
(1 file)
|
1.42 KB,
patch
|
Details | Diff | Splinter Review |
I was trying to throw custom objects instead of Error objects and noticed that JS_GetPendingException doesn't return those.
Here is a session in a slightly modified js shell.
js> throw new Error()
JS_GetPendingException: 1
typein:1:
js> throw new Object()
JS_GetPendingException: 0
uncaught exception: [object Object]
js>
shaver says this might be a bad bug.
Comment 1•17 years ago
|
||
We explicitly clear the exception before calling the error reporter for uncaught exceptions, I suspect in case the reporter calls script:
http://lxr.mozilla.org/mozilla/source/js/src/jsexn.c#1293
Set JSOPTION_DONT_REPORT_UNCAUGHT on the context if you don't want the conversion to error.
(Whew!)
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Comment 2•17 years ago
|
||
Or not. We should SetPending/ClearPending around both flavours of error-reporter calling.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
| Assignee | ||
Updated•11 years ago
|
Assignee: general → nobody
Updated•4 years ago
|
Status: REOPENED → RESOLVED
Closed: 17 years ago → 4 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•