summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSMessageChannelConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSMessageChannelConstructor.cpp')
-rw-r--r--WebCore/bindings/js/JSMessageChannelConstructor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/bindings/js/JSMessageChannelConstructor.cpp b/WebCore/bindings/js/JSMessageChannelConstructor.cpp
index 8da9f6d..8472250 100644
--- a/WebCore/bindings/js/JSMessageChannelConstructor.cpp
+++ b/WebCore/bindings/js/JSMessageChannelConstructor.cpp
@@ -55,7 +55,7 @@ JSMessageChannelConstructor::JSMessageChannelConstructor(ExecState* exec, Script
else
ASSERT_NOT_REACHED();
- putDirect(exec->propertyNames().prototype, JSMessageChannelPrototype::self(exec), None);
+ putDirect(exec->propertyNames().prototype, JSMessageChannelPrototype::self(exec, exec->lexicalGlobalObject()), None);
}
JSMessageChannelConstructor::~JSMessageChannelConstructor()
@@ -70,7 +70,11 @@ ConstructType JSMessageChannelConstructor::getConstructData(ConstructData& const
JSObject* JSMessageChannelConstructor::construct(ExecState* exec, JSObject* constructor, const ArgList&)
{
- return asObject(toJS(exec, MessageChannel::create(static_cast<JSMessageChannelConstructor*>(constructor)->scriptExecutionContext())));
+ ScriptExecutionContext* context = static_cast<JSMessageChannelConstructor*>(constructor)->scriptExecutionContext();
+ if (!context)
+ return throwError(exec, ReferenceError, "MessageChannel constructor associated document is unavailable");
+
+ return asObject(toJS(exec, MessageChannel::create(context)));
}
void JSMessageChannelConstructor::mark()