diff options
Diffstat (limited to 'src/script/api/qscriptcontext.cpp')
-rw-r--r-- | src/script/api/qscriptcontext.cpp | 8 |
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); |