summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptclassobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/bridge/qscriptclassobject.cpp')
-rw-r--r--src/script/bridge/qscriptclassobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp
index a7b5f48..dd229f1 100644
--- a/src/script/bridge/qscriptclassobject.cpp
+++ b/src/script/bridge/qscriptclassobject.cpp
@@ -234,7 +234,7 @@ JSC::JSObject* ClassObjectDelegate::construct(JSC::ExecState *exec, JSC::JSObjec
QScriptClass *scriptClass = static_cast<ClassObjectDelegate*>(delegate)->scriptClass();
QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec);
- //JSC::ExecState *oldFrame = eng_p->currentFrame;
+ JSC::ExecState *oldFrame = eng_p->currentFrame;
eng_p->pushContext(exec, JSC::JSValue(), args, callee, true);
QScriptContext *ctx = eng_p->contextForFrame(eng_p->currentFrame);
@@ -242,6 +242,8 @@ JSC::JSObject* ClassObjectDelegate::construct(JSC::ExecState *exec, JSC::JSObjec
QScriptValue result = qvariant_cast<QScriptValue>(scriptClass->extension(QScriptClass::Callable, qVariantFromValue(ctx)));
if (!result.isObject())
result = defaultObject;
+ eng_p->popContext();
+ eng_p->currentFrame = oldFrame;
return JSC::asObject(eng_p->scriptValueToJSCValue(result));
}