diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-14 14:03:18 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-14 14:03:18 (GMT) |
commit | e21e9b5a400115291c883b9b85055a8355f3a30b (patch) | |
tree | 8072e84826692738e7f8f294cf747eece340c3fa | |
parent | ecc2422553aebd9db06baa9c7a23b21351625947 (diff) | |
download | Qt-e21e9b5a400115291c883b9b85055a8355f3a30b.zip Qt-e21e9b5a400115291c883b9b85055a8355f3a30b.tar.gz Qt-e21e9b5a400115291c883b9b85055a8355f3a30b.tar.bz2 |
use originalGlobalObject() instead of lexicalGlobalObject() where possible
No need to look up the global object via the scope chain since we have
a direct pointer to it already.
-rw-r--r-- | src/script/api/qscriptengine.cpp | 4 | ||||
-rw-r--r-- | src/script/bridge/qscriptfunction.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index a87872a..207521d 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2160,7 +2160,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file #ifdef QT_BUILD_SCRIPT_LIB intptr_t sourceId = source.provider()->asID(); - JSC::Debugger* debugger = exec->lexicalGlobalObject()->debugger(); + JSC::Debugger* debugger = d->originalGlobalObject()->debugger(); exec->globalData().scriptpool->startEvaluating(source); if (debugger) debugger->evaluateStart(sourceId); @@ -2291,7 +2291,7 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, const JS //JSC doesn't create default created object for native functions. so we do it JSC::JSValue prototype = callee->get(exec, exec->propertyNames().prototype); JSC::Structure *structure = prototype.isObject() ? JSC::asObject(prototype)->inheritorID() - : exec->lexicalGlobalObject()->emptyObjectStructure(); + : originalGlobalObject()->emptyObjectStructure(); thisObject = new (exec) QScriptObject(structure); } diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp index f485bd8..396a787 100644 --- a/src/script/bridge/qscriptfunction.cpp +++ b/src/script/bridge/qscriptfunction.cpp @@ -119,7 +119,7 @@ JSC::JSObject* FunctionWrapper::proxyConstruct(JSC::ExecState *exec, JSC::JSObje QScriptValue result = self->data->function(ctx, QScriptEnginePrivate::get(eng_p)); #ifdef QT_BUILD_SCRIPT_LIB - if (JSC::Debugger* debugger = exec->lexicalGlobalObject()->debugger()) + if (JSC::Debugger* debugger = eng_p->originalGlobalObject()->debugger()) debugger->functionExit(QScriptValuePrivate::get(result)->jscValue, -1); #endif if (!result.isObject()) |