diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 08:46:54 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-08-11 08:46:54 (GMT) |
commit | a23288b0a563b6bcc3fc1cf49a224f21f531810c (patch) | |
tree | 5ca403a5de69cacfb1ece2fda4a6658921872f93 | |
parent | 10ae0cc37f667953167ff25d5eb74e2d4224bd79 (diff) | |
download | Qt-a23288b0a563b6bcc3fc1cf49a224f21f531810c.zip Qt-a23288b0a563b6bcc3fc1cf49a224f21f531810c.tar.gz Qt-a23288b0a563b6bcc3fc1cf49a224f21f531810c.tar.bz2 |
Calls to JSC::Debugger's new events that where created in
b62ab93d001d2f3238e24faa133720cb877e3023 commit.
Calls to Debuggers's evaluateStart, evaluateStop, exceptionThrow methods
where created.
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/Completion.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Completion.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Completion.cpp index b8b1581..92f82bf 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Completion.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Completion.cpp @@ -31,6 +31,11 @@ #include "Debugger.h" #include <stdio.h> +#ifdef QT_BUILD_SCRIPT_LIB +#include "DebuggerCallFrame.h" +#include "SourcePoolQt.h" +#endif + #if !PLATFORM(WIN_OS) #include <unistd.h> #endif @@ -54,12 +59,28 @@ Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& s { JSLock lock(exec); + intptr_t sourceId = source.provider()->asID(); +#ifdef QT_BUILD_SCRIPT_LIB + Debugger* debugger = exec->lexicalGlobalObject()->debugger(); + exec->globalData().scriptpool->startEvaluating(source); + if (debugger) + debugger->evaluateStart(sourceId); +#endif int errLine; UString errMsg; RefPtr<ProgramNode> programNode = exec->globalData().parser->parse<ProgramNode>(exec, exec->dynamicGlobalObject()->debugger(), source, &errLine, &errMsg); - if (!programNode) - return Completion(Throw, Error::create(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url())); + if (!programNode) { + JSValue error = Error::create(exec, SyntaxError, errMsg, errLine, sourceId, source.provider()->url()); +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) { + debugger->exceptionThrow(DebuggerCallFrame(exec, error), sourceId, false); + debugger->evaluateStop(error, sourceId); + } + exec->globalData().scriptpool->stopEvaluating(source); +#endif + return Completion(Throw, error); + } JSObject* thisObj = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec); @@ -67,10 +88,21 @@ Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& s JSValue result = exec->interpreter()->execute(programNode.get(), exec, scopeChain.node(), thisObj, &exception); if (exception) { +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) + debugger->evaluateStop(exception, sourceId); + exec->globalData().scriptpool->stopEvaluating(source); +#endif if (exception.isObject() && asObject(exception)->isWatchdogException()) return Completion(Interrupted, exception); return Completion(Throw, exception); } + +#ifdef QT_BUILD_SCRIPT_LIB + if (debugger) + debugger->evaluateStop(result, sourceId); + exec->globalData().scriptpool->stopEvaluating(source); +#endif return Completion(Normal, result); } |