Bug 1270977 - Replace a bunch of CallReceiver uses with CallArgs. r=efaust

--HG--
extra : rebase_source : eb10acb1a1886bddc463ae1fea4dd2b7ce6cb949
This commit is contained in:
Jeff Walden 2016-05-26 12:52:36 -07:00
Родитель 25223adcde
Коммит 9d18976540
5 изменённых файлов: 23 добавлений и 23 удалений

Просмотреть файл

@ -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<MapObject>().getData();
MOZ_ASSERT(args.thisv().isObject());
MOZ_ASSERT(args.thisv().toObject().hasClass(&MapObject::class_));
return *args.thisv().toObject().as<MapObject>().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<SetObject&>(call.thisv().toObject()).getData();
MOZ_ASSERT(args.thisv().isObject());
MOZ_ASSERT(args.thisv().toObject().hasClass(&SetObject::class_));
return *static_cast<SetObject&>(args.thisv().toObject()).getData();
}
uint32_t

Просмотреть файл

@ -117,8 +117,8 @@ class MapObject : public NativeObject {
static const JSFunctionSpec methods[];
static const JSPropertySpec staticProperties[];
ValueMap* getData() { return static_cast<ValueMap*>(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<ValueSet*>(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);

Просмотреть файл

@ -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()));
}
}
}

Просмотреть файл

@ -801,14 +801,14 @@ XDRInterpretedFunction(XDRState<mode>* 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[];

Просмотреть файл

@ -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<JSFunction>());
RootedFunction func(cx, &args.callee().as<JSFunction>());
RootedObject p(cx, func->getExtendedSlot(ScriptedProxyHandler::REVOKE_SLOT).toObjectOrNull());
if (p) {
@ -1404,7 +1404,7 @@ RevokeProxy(JSContext* cx, unsigned argc, Value* vp)
p->as<ProxyObject>().setExtra(ScriptedProxyHandler::HANDLER_EXTRA, NullValue());
}
rec.rval().setUndefined();
args.rval().setUndefined();
return true;
}