summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSSharedWorkerCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSSharedWorkerCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSSharedWorkerCustom.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/WebCore/bindings/js/JSSharedWorkerCustom.cpp b/WebCore/bindings/js/JSSharedWorkerCustom.cpp
index 261ae2b..0d576e0 100644
--- a/WebCore/bindings/js/JSSharedWorkerCustom.cpp
+++ b/WebCore/bindings/js/JSSharedWorkerCustom.cpp
@@ -70,7 +70,10 @@ EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(
DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
ExceptionCode ec = 0;
RefPtr<SharedWorker> worker = SharedWorker::create(ustringToString(scriptURL), ustringToString(name), window->document(), ec);
- setDOMException(exec, ec);
+ if (ec) {
+ setDOMException(exec, ec);
+ return JSValue::encode(JSValue());
+ }
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release())));
}