Skip to content

Commit

Permalink
Bug 1538006 - Propagate unknownProperties when changing prototype. r=…
Browse files Browse the repository at this point in the history
…jandem, a=dveditz

Differential Revision: https://phabricator.services.mozilla.com/D24446

--HG--
extra : histedit_source : 6fad0e8b10de518d78f0033cc1b48f78516def4a
  • Loading branch information
moztcampbell committed Mar 21, 2019
1 parent 3694067 commit 601d226
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/src/vm/NativeObject.cpp
Expand Up @@ -1268,12 +1268,15 @@ void js::AddPropertyTypesAfterProtoChange(JSContext* cx, NativeObject* obj,
MOZ_ASSERT(obj->group() != oldGroup);
MOZ_ASSERT(!obj->group()->unknownProperties(sweepObjGroup));

// First copy the dynamic flags.
AutoSweepObjectGroup sweepOldGroup(oldGroup);
if (oldGroup->unknownProperties(sweepOldGroup)) {
MarkObjectGroupUnknownProperties(cx, obj->group());
return;
}

// First copy the dynamic flags.
MarkObjectGroupFlags(
cx, obj,
oldGroup->flags(sweepOldGroup) &
(OBJECT_FLAG_DYNAMIC_MASK & ~OBJECT_FLAG_UNKNOWN_PROPERTIES));
cx, obj, oldGroup->flags(sweepOldGroup) & OBJECT_FLAG_DYNAMIC_MASK);

// Now update all property types. If the object has many properties, this
// function may be slow so we mark all properties as unknown.
Expand Down

0 comments on commit 601d226

Please sign in to comment.