diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-14 08:20:45 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-14 08:22:53 (GMT) |
commit | 67c15753452009953d012385a17ec1e45f003721 (patch) | |
tree | c1759dee492f29daca911e6c992d10dae4108e26 /src/script/api | |
parent | de9a5e011de1507c5650f49b3e2c67cb75884b5f (diff) | |
download | Qt-67c15753452009953d012385a17ec1e45f003721.zip Qt-67c15753452009953d012385a17ec1e45f003721.tar.gz Qt-67c15753452009953d012385a17ec1e45f003721.tar.bz2 |
Skip the fake context created by Interpreter::exucute for the backtrace
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptcontext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index f397ab5..04337df 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -362,6 +362,11 @@ QScriptContext *QScriptContext::parentContext() const { const JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this); JSC::CallFrame *callerFrame = frame->callerFrame()->removeHostCallFrameFlag(); + if (callerFrame && callerFrame->callerFrame()->hasHostCallFrameFlag() + && callerFrame->callerFrame()->removeHostCallFrameFlag() == QScript::scriptEngineFromExec(frame)->globalExec()) { + //skip the "fake" context created in Interpreter::execute. + callerFrame = callerFrame->callerFrame()->removeHostCallFrameFlag(); + } return reinterpret_cast<QScriptContext *>(callerFrame); } |