Backed out changeset 8ba41a1bd062 (bug 1348095)
This commit is contained in:
@@ -2410,35 +2410,16 @@ XrayWrapper<Base, Traits>::getPrototype(JSContext* cx, JS::HandleObject wrapper,
|
||||
// only if there's been a set. If there's not an expando, or the expando
|
||||
// slot is |undefined|, hand back the default proto, appropriately wrapped.
|
||||
|
||||
if (expando) {
|
||||
RootedValue v(cx);
|
||||
{ // Scope for JSAutoCompartment
|
||||
if (expando) {
|
||||
JSAutoCompartment ac(cx, expando);
|
||||
v = JS_GetReservedSlot(expando, JSSLOT_EXPANDO_PROTOTYPE);
|
||||
}
|
||||
if (!v.isUndefined()) {
|
||||
if (v.isUndefined())
|
||||
return getPrototypeHelper(cx, wrapper, target, protop);
|
||||
|
||||
protop.set(v.toObjectOrNull());
|
||||
return JS_WrapObject(cx, protop);
|
||||
}
|
||||
}
|
||||
|
||||
// Check our holder, and cache there if we don't have it cached already.
|
||||
RootedObject holder(cx, Traits::singleton.ensureHolder(cx, wrapper));
|
||||
if (!holder)
|
||||
return false;
|
||||
|
||||
Value cached = js::GetReservedSlot(holder,
|
||||
Traits::HOLDER_SLOT_CACHED_PROTO);
|
||||
if (cached.isUndefined()) {
|
||||
if (!getPrototypeHelper(cx, wrapper, target, protop))
|
||||
return false;
|
||||
|
||||
js::SetReservedSlot(holder, Traits::HOLDER_SLOT_CACHED_PROTO,
|
||||
ObjectOrNullValue(protop));
|
||||
} else {
|
||||
protop.set(cached.toObjectOrNull());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
|
||||
Reference in New Issue
Block a user