mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-04 13:37:32 +09:00
1320408 - Part 6: Change JSObject::splicePrototype to static method.
This commit is contained in:
parent
6a21912a94
commit
a38594f890
5 changed files with 13 additions and 13 deletions
|
|
@ -262,19 +262,18 @@ JSObject::shouldSplicePrototype(JSContext* cx)
|
|||
return isSingleton();
|
||||
}
|
||||
|
||||
bool
|
||||
JSObject::splicePrototype(JSContext* cx, const Class* clasp, Handle<TaggedProto> proto)
|
||||
/* static */ bool
|
||||
JSObject::splicePrototype(JSContext* cx, HandleObject obj, const Class* clasp,
|
||||
Handle<TaggedProto> proto)
|
||||
{
|
||||
MOZ_ASSERT(cx->compartment() == compartment());
|
||||
|
||||
RootedObject self(cx, this);
|
||||
MOZ_ASSERT(cx->compartment() == obj->compartment());
|
||||
|
||||
/*
|
||||
* For singleton groups representing only a single JSObject, the proto
|
||||
* can be rearranged as needed without destroying type information for
|
||||
* the old or new types.
|
||||
*/
|
||||
MOZ_ASSERT(self->isSingleton());
|
||||
MOZ_ASSERT(obj->isSingleton());
|
||||
|
||||
// Windows may not appear on prototype chains.
|
||||
MOZ_ASSERT_IF(proto.isObject(), !IsWindow(proto.toObject()));
|
||||
|
|
@ -283,7 +282,7 @@ JSObject::splicePrototype(JSContext* cx, const Class* clasp, Handle<TaggedProto>
|
|||
return false;
|
||||
|
||||
// Force type instantiation when splicing lazy group.
|
||||
RootedObjectGroup group(cx, JSObject::getGroup(cx, self));
|
||||
RootedObjectGroup group(cx, JSObject::getGroup(cx, obj));
|
||||
if (!group)
|
||||
return false;
|
||||
RootedObjectGroup protoGroup(cx, nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue