diff options
Diffstat (limited to 'WebCore/bindings/v8/NPV8Object.cpp')
-rw-r--r-- | WebCore/bindings/v8/NPV8Object.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp index cb2a6c1..13403ec 100644 --- a/WebCore/bindings/v8/NPV8Object.cpp +++ b/WebCore/bindings/v8/NPV8Object.cpp @@ -276,7 +276,7 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri filename = "npscript"; WebCore::String script = WebCore::String::fromUTF8(npScript->UTF8Characters, npScript->UTF8Length); - v8::Local<v8::Value> v8result = proxy->evaluate(WebCore::ScriptSourceCode(script, WebCore::KURL(filename)), 0); + v8::Local<v8::Value> v8result = proxy->evaluate(WebCore::ScriptSourceCode(script, WebCore::KURL(WebCore::ParsedURLString, filename)), 0); if (v8result.IsEmpty()) return false; @@ -413,8 +413,12 @@ bool _NPN_HasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName) void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) { - if (npObject->_class != npScriptObjectClass) + if (npObject->_class != npScriptObjectClass) { + // We won't be able to find a proper scope for this exception, so just throw it. + // This is consistent with JSC, which throws a global exception all the time. + V8Proxy::throwError(V8Proxy::GeneralError, message); return; + } v8::HandleScope handleScope; v8::Handle<v8::Context> context = toV8Context(0, npObject); if (context.IsEmpty()) |