summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/Completion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/Completion.cpp')
-rw-r--r--JavaScriptCore/runtime/Completion.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/JavaScriptCore/runtime/Completion.cpp b/JavaScriptCore/runtime/Completion.cpp
index 2f88df9..eeb8b0d 100644
--- a/JavaScriptCore/runtime/Completion.cpp
+++ b/JavaScriptCore/runtime/Completion.cpp
@@ -29,6 +29,7 @@
#include "Interpreter.h"
#include "Parser.h"
#include "Debugger.h"
+#include "WTFThreadData.h"
#include <stdio.h>
namespace JSC {
@@ -36,7 +37,7 @@ namespace JSC {
Completion checkSyntax(ExecState* exec, const SourceCode& source)
{
JSLock lock(exec);
- ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
+ ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
JSObject* error = program->checkSyntax(exec);
@@ -49,7 +50,7 @@ Completion checkSyntax(ExecState* exec, const SourceCode& source)
Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& source, JSValue thisValue)
{
JSLock lock(exec);
- ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
+ ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
JSObject* error = program->compile(exec, scopeChain.node());
@@ -58,13 +59,16 @@ Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& s
JSObject* thisObj = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec);
- JSValue exception;
- JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain.node(), thisObj, &exception);
+ JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain.node(), thisObj);
- if (exception) {
- if (exception.isObject() && asObject(exception)->isWatchdogException())
- return Completion(Interrupted, exception);
- return Completion(Throw, exception);
+ if (exec->hadException()) {
+ JSValue exception = exec->exception();
+ exec->clearException();
+
+ ComplType exceptionType = Throw;
+ if (exception.isObject())
+ exceptionType = asObject(exception)->exceptionType();
+ return Completion(exceptionType, exception);
}
return Completion(Normal, result);
}