Bug 1134969. Make DeepCloneObjectLiteral correctly handle setLastProperty failures. r=waldo

This commit is contained in:
Boris Zbarsky
2015-02-24 16:04:22 -05:00
parent d8d38e06f2
commit 36b39012f8

View File

@@ -1869,7 +1869,8 @@ js::DeepCloneObjectLiteral(JSContext *cx, HandleNativeObject obj, NewObjectKind
MOZ_ASSERT(!obj->hasPrivate());
RootedShape shape(cx, obj->lastProperty());
size_t span = shape->slotSpan();
clone->setLastProperty(cx, shape);
if (!clone->setLastProperty(cx, shape))
return nullptr;
for (size_t i = 0; i < span; i++) {
v = obj->getSlot(i);
if (v.isObject()) {