summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptcontext.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-28 09:50:57 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-28 09:57:08 (GMT)
commitacac0684d0eb13792cbb8b9bde6f077642dcc640 (patch)
treead5272b020b90380b92747fefce7af894559b8ef /src/script/api/qscriptcontext.cpp
parent9e9f896312edf68584bea5c9b70ec0f1205a11ab (diff)
downloadQt-acac0684d0eb13792cbb8b9bde6f077642dcc640.zip
Qt-acac0684d0eb13792cbb8b9bde6f077642dcc640.tar.gz
Qt-acac0684d0eb13792cbb8b9bde6f077642dcc640.tar.bz2
Fix tst_QScriptEngine::nestedEvaluate
The 'this' value was not correctly set when evaluating Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/api/qscriptcontext.cpp')
-rw-r--r--src/script/api/qscriptcontext.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 8d4fe18..c286a70 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -452,13 +452,7 @@ void QScriptContext::setActivationObject(const QScriptValue &activation)
QScriptValue QScriptContext::thisObject() const
{
Q_D(const QScriptContext);
- JSC::JSValue result;
- if (d->frame->codeBlock() != 0) {
- result = d->frame->thisValue();
- } else {
- JSC::Register* thisRegister = d->frame->registers() - JSC::RegisterFile::CallFrameHeaderSize - d->frame->argumentCount();
- result = thisRegister->jsValue();
- }
+ JSC::JSValue result = d->engine->thisForContext(d->frame);
if (!result || result.isNull())
result = d->frame->globalThisValue();
return d->engine->scriptValueFromJSCValue(result);