diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index b3d42fafafd6..652927ecb776 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -586,11 +586,11 @@ MapObject::extract(HandleObject o) } ValueMap& -MapObject::extract(CallReceiver call) +MapObject::extract(const CallArgs& args) { - MOZ_ASSERT(call.thisv().isObject()); - MOZ_ASSERT(call.thisv().toObject().hasClass(&MapObject::class_)); - return *call.thisv().toObject().as().getData(); + MOZ_ASSERT(args.thisv().isObject()); + MOZ_ASSERT(args.thisv().toObject().hasClass(&MapObject::class_)); + return *args.thisv().toObject().as().getData(); } uint32_t @@ -1208,11 +1208,11 @@ SetObject::extract(HandleObject o) } ValueSet & -SetObject::extract(CallReceiver call) +SetObject::extract(const CallArgs& args) { - MOZ_ASSERT(call.thisv().isObject()); - MOZ_ASSERT(call.thisv().toObject().hasClass(&SetObject::class_)); - return *static_cast(call.thisv().toObject()).getData(); + MOZ_ASSERT(args.thisv().isObject()); + MOZ_ASSERT(args.thisv().toObject().hasClass(&SetObject::class_)); + return *static_cast(args.thisv().toObject()).getData(); } uint32_t diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index f478a34a9fe9..a2262a001642 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -117,8 +117,8 @@ class MapObject : public NativeObject { static const JSFunctionSpec methods[]; static const JSPropertySpec staticProperties[]; ValueMap* getData() { return static_cast(getPrivate()); } - static ValueMap & extract(HandleObject o); - static ValueMap & extract(CallReceiver call); + static ValueMap& extract(HandleObject o); + static ValueMap& extract(const CallArgs& args); static void mark(JSTracer* trc, JSObject* obj); static void finalize(FreeOp* fop, JSObject* obj); static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp); @@ -204,8 +204,8 @@ class SetObject : public NativeObject { static const JSPropertySpec staticProperties[]; ValueSet* getData() { return static_cast(getPrivate()); } - static ValueSet & extract(HandleObject o); - static ValueSet & extract(CallReceiver call); + static ValueSet& extract(HandleObject o); + static ValueSet& extract(const CallArgs& args); static void mark(JSTracer* trc, JSObject* obj); static void finalize(FreeOp* fop, JSObject* obj); static bool construct(JSContext* cx, unsigned argc, Value* vp); diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index b33263fb4572..6b1f1e3c3127 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -2341,9 +2341,9 @@ js::DefineFunction(JSContext* cx, HandleObject obj, HandleId id, Native native, } void -js::ReportIncompatibleMethod(JSContext* cx, CallReceiver call, const Class* clasp) +js::ReportIncompatibleMethod(JSContext* cx, const CallArgs& args, const Class* clasp) { - RootedValue thisv(cx, call.thisv()); + RootedValue thisv(cx, args.thisv()); #ifdef DEBUG if (thisv.isObject()) { @@ -2364,7 +2364,7 @@ js::ReportIncompatibleMethod(JSContext* cx, CallReceiver call, const Class* clas } #endif - if (JSFunction* fun = ReportIfNotFunction(cx, call.calleev())) { + if (JSFunction* fun = ReportIfNotFunction(cx, args.calleev())) { JSAutoByteString funNameBytes; if (const char* funName = GetFunctionNameBytes(cx, fun, &funNameBytes)) { JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO, @@ -2374,13 +2374,13 @@ js::ReportIncompatibleMethod(JSContext* cx, CallReceiver call, const Class* clas } void -js::ReportIncompatible(JSContext* cx, CallReceiver call) +js::ReportIncompatible(JSContext* cx, const CallArgs& args) { - if (JSFunction* fun = ReportIfNotFunction(cx, call.calleev())) { + if (JSFunction* fun = ReportIfNotFunction(cx, args.calleev())) { JSAutoByteString funNameBytes; if (const char* funName = GetFunctionNameBytes(cx, fun, &funNameBytes)) { JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_METHOD, - funName, "method", InformalValueTypeName(call.thisv())); + funName, "method", InformalValueTypeName(args.thisv())); } } } diff --git a/js/src/jsfun.h b/js/src/jsfun.h index a145437dcb4a..42ef94babbd5 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -801,14 +801,14 @@ XDRInterpretedFunction(XDRState* xdr, HandleObject enclosingScope, * is what was called. */ extern void -ReportIncompatibleMethod(JSContext* cx, CallReceiver call, const Class* clasp); +ReportIncompatibleMethod(JSContext* cx, const CallArgs& args, const Class* clasp); /* * Report an error that call.thisv is not an acceptable this for the callee * function. */ extern void -ReportIncompatible(JSContext* cx, CallReceiver call); +ReportIncompatible(JSContext* cx, const CallArgs& args); extern const JSFunctionSpec function_methods[]; extern const JSFunctionSpec function_selfhosted_methods[]; diff --git a/js/src/proxy/ScriptedProxyHandler.cpp b/js/src/proxy/ScriptedProxyHandler.cpp index 49a4d75db784..9ee2f75a4c06 100644 --- a/js/src/proxy/ScriptedProxyHandler.cpp +++ b/js/src/proxy/ScriptedProxyHandler.cpp @@ -1390,9 +1390,9 @@ js::proxy(JSContext* cx, unsigned argc, Value* vp) static bool RevokeProxy(JSContext* cx, unsigned argc, Value* vp) { - CallReceiver rec = CallReceiverFromVp(vp); + CallArgs args = CallArgsFromVp(argc, vp); - RootedFunction func(cx, &rec.callee().as()); + RootedFunction func(cx, &args.callee().as()); RootedObject p(cx, func->getExtendedSlot(ScriptedProxyHandler::REVOKE_SLOT).toObjectOrNull()); if (p) { @@ -1404,7 +1404,7 @@ RevokeProxy(JSContext* cx, unsigned argc, Value* vp) p->as().setExtra(ScriptedProxyHandler::HANDLER_EXTRA, NullValue()); } - rec.rval().setUndefined(); + args.rval().setUndefined(); return true; }