X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..81345200c95645a1b0d2635520f96ad55dfde63f:/runtime/CallData.cpp?ds=sidebyside diff --git a/runtime/CallData.cpp b/runtime/CallData.cpp index ff71fa0..6d00109 100644 --- a/runtime/CallData.cpp +++ b/runtime/CallData.cpp @@ -29,14 +29,27 @@ #include "Executable.h" #include "Interpreter.h" #include "JSFunction.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, JSValue* exception) +{ + JSValue result = call(exec, functionObject, callType, callData, thisValue, args); + if (exec->hadException()) { + if (exception) + *exception = exec->exception(); + exec->clearException(); + return jsUndefined(); + } + RELEASE_ASSERT(result); + return result; +} + } // namespace JSC