From 3983c9f396ca642caec2387bfe76fa6a9ca233f3 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 15 Jul 2009 14:17:24 +0200 Subject: avoid crashing when attempting to set this-object of global context --- src/script/api/qscriptcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index f7ed83e..fc34122 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -480,6 +480,10 @@ void QScriptContext::setThisObject(const QScriptValue &thisObject) "a different engine"); return; } + if (d->frame == d->engine->globalObject->globalExec()) { + qWarning("QScriptContext::setThisObject(): setting this-object of global context is not supported"); + return; + } JSC::JSValue jscThisObject = d->engine->scriptValueToJSCValue(thisObject); JSC::CodeBlock *cb = d->frame->codeBlock(); if (cb != 0) { -- cgit v0.12