Closed
Bug 1107777
Opened 10 years ago
Closed 10 years ago
js::ReportError() should set exception on cx if embedder is going to handle it, even if script is not running.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
nsm
:
review+
|
Details | Diff | Splinter Review |
ReportError() currently gates on JS_IsRunning() before setting the exception on the context. Otherwise it just reports the error. In cases where the embedder sets dontReportUncaught, this leads to it not being unable to handle the exception in cases where script doesn't run, but we use the JSAPI (JS_ParseJSON for example).
Assignee | ||
Comment 1•10 years ago
|
||
If JS is not running, the error reporting infrastructure just reports the
exception to the error reporter. This prevents the embedder from handling it
after setting dontReportUncaught since js_ErrorToException isn't called. This
patch sets the exception even if JS is not running if the embedder will handle
it.
Attachment #8532327 -
Flags: review?(bobbyholley)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Assignee | ||
Updated•10 years ago
|
Blocks: dom-fetch-api
Updated•10 years ago
|
Attachment #8532327 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8532327 [details] [diff] [review]
Try to set exception on JSContext if embedder will handle it
this patch is wrong and fails some tests.
Attachment #8532327 -
Attachment is obsolete: true
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8537348 -
Flags: review?(bobbyholley)
Comment 4•10 years ago
|
||
Comment on attachment 8537348 [details] [diff] [review]
Add autoJSAPIOwnsErrorReporting flag to JSContext options. AutoJSAPI sets it
Review of attachment 8537348 [details] [diff] [review]:
-----------------------------------------------------------------
Look great! thanks for doing this.
::: js/src/jsapi.h
@@ +1640,4 @@
> private:
> bool privateIsNSISupports_ : 1;
> bool dontReportUncaught_ : 1;
> + bool autoJSAPIOwnsErrorReporting_ : 1;
Add a comment here explaining why we're doing this - dontReportUncaught is kind of random in Gecko at the moment, and we want a clear indicator that the embedding is going to take ownership of error reporting. Also note that this should eventually become the default and both options will go away.
Attachment #8537348 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8537348 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8537368 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 7•10 years ago
|
||
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment 9•10 years ago
|
||
I'm recently (last 1-2 nightlies) getting some crashes with the top third frame showing code that was added with this changeset in bug 1114079.
The crash happens in "js_ErrorToException(cx, message, reportp, callback, userRef)".
I'll set the bug blocking this one, please correct me if I'm wrong.
Comment 10•10 years ago
|
||
:nsm
It looks like this changeset caused bug 1114079. Please have a look at the comment above and the linked bug.
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(nsm.nikhil)
You need to log in
before you can comment on or make changes to this bug.
Description
•