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.
See also: bug 17470.
This bug blocks Google Gears support in Safari.
Working on a real fix as we speak.
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...
<rdar://problem/6089187>
Related to Bug 19936?
This is stll likely a bug, but Gears no longer cares since Gears is dead.
NPAPI is gone.