Bug 18234
Summary: | JS exception thrown from NPN_InvokeDefault not shown in error console. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jeremy Moskovich <playmobil> |
Component: | Plug-ins | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ap, ddkilzer, dglazkov, emacemac7, ggaren, mjs, oliver |
Priority: | P2 | Keywords: | GoogleBug, InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Jeremy Moskovich
Invoking the following JS code from an NPAPI plug-in via the NPN_InvokeDefault() function doesn't show the exception in the error console:
function() { throw "An Exception"; }
Stepping into _NPN_InvokeDefault() in NP_jsobject.cpp shows that the exception appears to have been set correctly in the ExecState but this apparently isn't bubbled up when the plugin code returns control to the browser.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
See also: bug 17470.
Eric Seidel (no email)
This bug blocks Google Gears support in Safari.
Eric Seidel (no email)
Working on a real fix as we speak.
Eric Seidel (no email)
Updating the bug, finally. This is very much tied to the NPN_SetException bug. The fix is to save off the current ExecState in a static (or per-thread) static, and then throw the exception in that ExecState. I tried saving the ExecState on the Instance, however that doesn't work for Obj-C (since it's a static method), and doesn't work well for JS/C++ either since you have to be thrown an JavaScriptObject in order to be able to get back to an Instance.
I may find time to finish up my patch, but right now real work is distracting...
David Kilzer (:ddkilzer)
<rdar://problem/6089187>
David Kilzer (:ddkilzer)
Related to Bug 19936?
Eric Seidel (no email)
This is stll likely a bug, but Gears no longer cares since Gears is dead.
Alexey Proskuryakov
NPAPI is gone.