Closed
Bug 451571
Opened 16 years ago
Closed 16 years ago
Delete SetExceptionWasThrown
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(1 file, 1 obsolete file)
23.67 KB,
patch
|
dbradley
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
There's only one call to GetExceptionWasThrown, and it can use JS_IsExceptionPending instead. Deleting this will reduce the number of calls to GetCurrentNativeCallContext. See bug 407216 comment 95 paragraph 2 and subsequent discussion.
Assignee | ||
Comment 1•16 years ago
|
||
I am a little puzzled about the apparently common idiom in COM-style methods of setting a pending JS exception, then returning NS_OK. Examples: nsJSContext::EvaluateStringWithValue mozJSComponentLoader::ReportOnCaller (and its callers) nsJSCID::CreateInstance when the security manager vetoes mozJSSubScriptLoader::LoadSubScript It seems weird not to tell the caller that the call failed. Why does it work this way?
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•16 years ago
|
||
Re comment 1, here's one explanation: http://hg.mozilla.org/mozilla-central/index.cgi/file/73967cc9e4ee/js/src/xpconnect/public/nsAXPCNativeCallContext.h#l67 but it seems like CallMethod should just see that an exception is already pending and just propagate that.
Assignee | ||
Comment 3•16 years ago
|
||
Contrary to the URL comment cited in comment 2, there are also places where a C++ function sets an exception and then returns a failure nsresult: nsScriptSecurityManager::CheckPropertyAccessImpl nsJSScriptTimeoutHandler::Init xpcJSWeakReference::Init Maybe there should be an NS_ERROR_JS_EXCEPTION_THROWN code for this case.
Assignee | ||
Comment 4•16 years ago
|
||
Assignee: nobody → jorendorff
Attachment #334936 -
Flags: review?
Assignee | ||
Updated•16 years ago
|
Attachment #334936 -
Flags: review? → review?(dbradley)
Assignee | ||
Comment 5•16 years ago
|
||
(Sorry for the noise. The only difference between v1 and v2 is that v1 had a few lines of nonsense in xpcprivate.h.)
Attachment #334936 -
Attachment is obsolete: true
Attachment #334937 -
Flags: review?(dbradley)
Attachment #334936 -
Flags: review?(dbradley)
Assignee | ||
Updated•16 years ago
|
Attachment #334937 -
Flags: superreview?(jst)
Comment 6•16 years ago
|
||
Almost done with the review, should have it done this evening or tomorrow 8/24
Comment 7•16 years ago
|
||
I need to run a couple of more scenario's in my head. I'm just concerned that we might end up capturing more than what we were before, though I'm thinking that's probably not a bad thing. The code looks fine.
Comment 8•16 years ago
|
||
Comment on attachment 334937 [details] [diff] [review] v2 r=dbradley Changes look fine. My only concern was that we might pick up some JS exceptions that we weren't picking up before in the XPCWrappedNative::CallMethod. But I don't think that's necessarily a bad thing and might be considered a flaw in the original logic. The patch is a bit stale, there were a couple of hunks that wouldn't apply, but was easy enough to work around.
Attachment #334937 -
Flags: review?(dbradley) → review+
Updated•16 years ago
|
Attachment #334937 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/b4d9de8ad106
You need to log in
before you can comment on or make changes to this bug.
Description
•