Closed
Bug 1206817
Opened 9 years ago
Closed 9 years ago
mozJSComponentLoader::ImportInto has fishy exception handling
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: bzbarsky, Unassigned)
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•9 years ago
|
||
Er, this bit:
JSCLContextHelper cxhelper(callercx);
...
dom::AutoJSAPI jsapi;
jsapi.Init();
JSContext* cx = jsapi.cx();
...
if (!JS_GetProperty(cx, modObj,
"EXPORTED_SYMBOLS", &symbols)) {
return ReportOnCaller(cxhelper, ERROR_NOT_PRESENT,
PromiseFlatCString(aLocation).get());
}
and similar later for JS_GetArrayLength and JS_GetElement failures and whatnot.
If JS_GetProperty there throws, there will be an exception on cx. We don't seem to report it or anything. Then we do the ReportOnCaller thing, which does something with exceptions on callercx, which need not be the same thing as cx at all.
Not sure whether we should just suppress the exception on cx, or report it in addition to whatever we do with ReportOnCaller.
Flags: needinfo?(bobbyholley)
Comment 2•9 years ago
|
||
Ugh, this stuff is gross. I think we should .TakeOwnershipOfErrorReporting() on these AutoJSAPIs, and let the internal exception in the JSM scope be reported to the browser console, where somebody can look at it if they want more detail on what happened.
I'll push a patch to try and see if that breaks anything.
Flags: needinfo?(bobbyholley)
Comment 3•9 years ago
|
||
Attachment #8663872 -
Flags: review?(bzbarsky)
Comment 4•9 years ago
|
||
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8663872 [details] [diff] [review]
Take ownership of error reporting in JSM loading. v1
r=me
Attachment #8663872 -
Flags: review?(bzbarsky) → review+
Comment 7•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•