diff options
Diffstat (limited to 'JavaScriptCore/runtime/FunctionPrototype.cpp')
-rw-r--r-- | JavaScriptCore/runtime/FunctionPrototype.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/JavaScriptCore/runtime/FunctionPrototype.cpp b/JavaScriptCore/runtime/FunctionPrototype.cpp index 1762816..15392cf 100644 --- a/JavaScriptCore/runtime/FunctionPrototype.cpp +++ b/JavaScriptCore/runtime/FunctionPrototype.cpp @@ -34,9 +34,9 @@ namespace JSC { ASSERT_CLASS_FITS_IN_CELL(FunctionPrototype); -static JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*, JSObject*, JSValue, const ArgList&); -static JSValue JSC_HOST_CALL functionProtoFuncApply(ExecState*, JSObject*, JSValue, const ArgList&); -static JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*, JSObject*, JSValue, const ArgList&); +static JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*); +static JSValue JSC_HOST_CALL functionProtoFuncApply(ExecState*); +static JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*); FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure) : InternalFunction(&exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier) @@ -53,7 +53,7 @@ void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* g putDirectFunctionWithoutTransition(exec, *callFunction, DontEnum); } -static JSValue JSC_HOST_CALL callFunctionPrototype(ExecState*, JSObject*, JSValue, const ArgList&) +static JSValue JSC_HOST_CALL callFunctionPrototype(ExecState*) { return jsUndefined(); } @@ -83,8 +83,9 @@ static inline void insertSemicolonIfNeeded(UString& functionBody) } } -JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) +JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec) { + JSValue thisValue = exec->hostThisValue(); if (thisValue.inherits(&JSFunction::info)) { JSFunction* function = asFunction(thisValue); if (function->isHostFunction()) @@ -103,14 +104,15 @@ JSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec, JSObject*, JSVa return throwError(exec, TypeError); } -JSValue JSC_HOST_CALL functionProtoFuncApply(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +JSValue JSC_HOST_CALL functionProtoFuncApply(ExecState* exec) { + JSValue thisValue = exec->hostThisValue(); CallData callData; CallType callType = thisValue.getCallData(callData); if (callType == CallTypeNone) return throwError(exec, TypeError); - JSValue array = args.at(1); + JSValue array = exec->argument(1); MarkedArgumentBuffer applyArgs; if (!array.isUndefinedOrNull()) { @@ -128,19 +130,21 @@ JSValue JSC_HOST_CALL functionProtoFuncApply(ExecState* exec, JSObject*, JSValue return throwError(exec, TypeError); } - return call(exec, thisValue, callType, callData, args.at(0), applyArgs); + return call(exec, thisValue, callType, callData, exec->argument(0), applyArgs); } -JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState* exec) { + JSValue thisValue = exec->hostThisValue(); CallData callData; CallType callType = thisValue.getCallData(callData); if (callType == CallTypeNone) return throwError(exec, TypeError); + ArgList args(exec); ArgList callArgs; args.getSlice(1, callArgs); - return call(exec, thisValue, callType, callData, args.at(0), callArgs); + return call(exec, thisValue, callType, callData, exec->argument(0), callArgs); } } // namespace JSC |