From 208594091a0bfd625c463dfa872d02b1c32d6cd0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 12 Aug 2009 16:33:30 +0200 Subject: Push frames when needed for native getter or setters This is some other places where Qt native function may expect to have their own context --- src/script/bridge/qscriptqobject.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index a15e632..f749e7c 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1028,7 +1028,9 @@ JSC::JSValue JSC_HOST_CALL QtFunction::call(JSC::ExecState *exec, JSC::JSObject QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec); JSC::ExecState *previousFrame = eng_p->currentFrame; eng_p->currentFrame = exec; - JSC::JSValue result = qfun->execute(exec, thisValue, args); + eng_p->pushContext(exec, thisValue, args, callee); + JSC::JSValue result = qfun->execute(eng_p->currentFrame, thisValue, args); + eng_p->popContext(); eng_p->currentFrame = previousFrame; return result; } @@ -1065,7 +1067,9 @@ JSC::JSValue JSC_HOST_CALL QtPropertyFunction::call( QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec); JSC::ExecState *previousFrame = eng_p->currentFrame; eng_p->currentFrame = exec; - JSC::JSValue result = qfun->execute(exec, thisValue, args); + eng_p->pushContext(exec, thisValue, args, callee); + JSC::JSValue result = qfun->execute(eng_p->currentFrame, thisValue, args); + eng_p->popContext(); eng_p->currentFrame = previousFrame; return result; } -- cgit v0.12