X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/CallData.cpp?ds=sidebyside diff --git a/runtime/CallData.cpp b/runtime/CallData.cpp index 8e1d194..31c28c3 100644 --- a/runtime/CallData.cpp +++ b/runtime/CallData.cpp @@ -29,15 +29,26 @@ #include "Executable.h" #include "Interpreter.h" #include "JSFunction.h" -#include "Operations.h" +#include "JSCInlines.h" namespace JSC { JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args) { ASSERT(callType == CallTypeJS || callType == CallTypeHost); - ASSERT(isValidThisObject(thisValue, exec)); return exec->interpreter()->executeCall(exec, asObject(functionObject), callType, callData, thisValue, args); } +JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args, NakedPtr& returnedException) +{ + JSValue result = call(exec, functionObject, callType, callData, thisValue, args); + if (exec->hadException()) { + returnedException = exec->exception(); + exec->clearException(); + return jsUndefined(); + } + RELEASE_ASSERT(result); + return result; +} + } // namespace JSC