diff options
Diffstat (limited to 'JavaScriptCore/runtime/Completion.cpp')
-rw-r--r-- | JavaScriptCore/runtime/Completion.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/JavaScriptCore/runtime/Completion.cpp b/JavaScriptCore/runtime/Completion.cpp index 9af5171..eeb8b0d 100644 --- a/JavaScriptCore/runtime/Completion.cpp +++ b/JavaScriptCore/runtime/Completion.cpp @@ -59,10 +59,12 @@ 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 (exec->hadException()) { + JSValue exception = exec->exception(); + exec->clearException(); - if (exception) { ComplType exceptionType = Throw; if (exception.isObject()) exceptionType = asObject(exception)->exceptionType(); |