summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-10-06 08:52:17 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-10-06 08:52:17 (GMT)
commit58563dcb2cab0949d21337b7b7cd34e3bdd29bbc (patch)
tree2715d69c247748ba1501e50ec432415d3ffebcae /src/script/api/qscriptengine.cpp
parent564f65bdcf42bcdaceea902b99bcbfafef5b97f3 (diff)
parent2dc7fae7ea38a0169c4c5c78d0534d688347aacb (diff)
downloadQt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.zip
Qt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.tar.gz
Qt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.tar.bz2
Merge branch '4.6'
Conflicts: src/corelib/io/qdatastream.h
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index fb14940..3402190 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -805,7 +805,6 @@ QScriptEnginePrivate::QScriptEnginePrivate()
JSC::JSGlobalObject *globalObject = new (globalData)QScript::GlobalObject();
JSC::ExecState* exec = globalObject->globalExec();
- *thisRegisterForFrame(exec) = JSC::JSValue();
scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());
@@ -1079,12 +1078,13 @@ JSC::JSValue QScriptEnginePrivate::toUsableValue(JSC::JSValue value)
/*!
\internal
Return the 'this' value for a given context
- The result may be null for the global context
*/
JSC::JSValue QScriptEnginePrivate::thisForContext(JSC::ExecState *frame)
{
if (frame->codeBlock() != 0) {
return frame->thisValue();
+ } else if(frame == frame->lexicalGlobalObject()->globalExec()) {
+ return frame->globalThisValue();
} else {
JSC::Register *thisRegister = thisRegisterForFrame(frame);
return thisRegister->jsValue();
@@ -2168,7 +2168,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
exec->clearException();
JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject());
- JSC::EvalExecutable executable(source);
+ JSC::EvalExecutable executable(exec, source);
JSC::JSObject* error = executable.compile(exec, exec->scopeChain());
if (error) {
exec->setException(error);