Bug 957688 - Remove side-effect-y call to js::CheckAccess, and remove js::CheckAccess itself. r=mrbkap

Thankfully, this case was only taking the JSACC_PROTO, which is significantly
simpler than the alternative.
This commit is contained in:
Bobby Holley 2014-01-24 16:08:25 -08:00
parent 3bf47f1f26
commit abb3c5c1c7

View File

@ -82,14 +82,11 @@ ProtoGetterImpl(JSContext *cx, CallArgs args)
if (thisv.isPrimitive() && !BoxNonStrictThis(cx, args))
return false;
unsigned dummy;
RootedObject obj(cx, &args.thisv().toObject());
RootedId nid(cx, NameToId(cx->names().proto));
RootedValue v(cx);
if (!CheckAccess(cx, obj, nid, JSACC_PROTO, &v, &dummy))
RootedObject proto(cx);
if (!JSObject::getProto(cx, obj, &proto))
return false;
args.rval().set(v);
args.rval().setObjectOrNull(proto);
return true;
}