diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-15 12:17:24 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-15 12:17:24 (GMT) |
commit | 3983c9f396ca642caec2387bfe76fa6a9ca233f3 (patch) | |
tree | b46774bd168236b33094db79aafd9a65306987c4 /src/script/api | |
parent | 8e932d7d53168fda6ed39109659efcaf88a32487 (diff) | |
download | Qt-3983c9f396ca642caec2387bfe76fa6a9ca233f3.zip Qt-3983c9f396ca642caec2387bfe76fa6a9ca233f3.tar.gz Qt-3983c9f396ca642caec2387bfe76fa6a9ca233f3.tar.bz2 |
avoid crashing when attempting to set this-object of global context
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptcontext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |