diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 10:59:22 +0200 |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 10:59:22 +0200 |
commit | 938c50675fbcc6659e25921caf41a06f2d8a49cb (patch) | |
tree | 609a00e1b456a76123a6b59ee9d0eeb75d70cbc1 /src/script/bridge | |
parent | a23288b0a563b6bcc3fc1cf49a224f21f531810c (diff) | |
download | qt4-tools-938c50675fbcc6659e25921caf41a06f2d8a49cb.tar.gz |
Call to JSC::Debugger's new events that where created in
b62ab93d001d2f3238e24faa133720cb877e3023 commit.
Workaround for multiple decorators problem. FunctionWrapper and
NativeConstrWrapper needs access to original result value (from native
function call). Solution was to move part of the NativeConstrWrapper's
functionality (functionExit debugger's event) to
FunctionWrapper::proxyConstruct.
Diffstat (limited to 'src/script/bridge')
-rw-r--r-- | src/script/bridge/qscriptfunction.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp index ac8ca8312a..2124128061 100644 --- a/src/script/bridge/qscriptfunction.cpp +++ b/src/script/bridge/qscriptfunction.cpp @@ -44,9 +44,12 @@ #include "private/qscriptengine_p.h" #include "qscriptcontext.h" #include "private/qscriptcontext_p.h" +#include "private/qscriptvalue_p.h" #include "qscriptactivationobject_p.h" #include "JSGlobalObject.h" +#include "DebuggerCallFrame.h" +#include "Debugger.h" namespace JSC @@ -77,6 +80,9 @@ FunctionWrapper::~FunctionWrapper() JSC::ConstructType FunctionWrapper::getConstructData(JSC::ConstructData& consData) { consData.native.function = proxyConstruct; +#ifdef QT_BUILD_SCRIPT_LIB + consData.native.function.doNotCallDebuggerFunctionExit(); +#endif return JSC::ConstructTypeHost; } @@ -108,7 +114,12 @@ JSC::JSObject* FunctionWrapper::proxyConstruct(JSC::ExecState *exec, JSC::JSObje QScriptPushScopeHelper scope(exec, true); QScriptValue defaultObject = ctx->thisObject(); + QScriptValue result = self->data->function(ctx, QScriptEnginePrivate::get(eng_p)); +#ifdef QT_BUILD_SCRIPT_LIB + if (JSC::Debugger* debugger = exec->lexicalGlobalObject()->debugger()) + debugger->functionExit(QScriptValuePrivate::get(result)->jscValue, -1); +#endif if (!result.isObject()) result = defaultObject; |