Bug 1107496 - Add PlainObject subclass, r=luke.

This commit is contained in:
Brian Hackett
2014-12-05 07:27:37 -07:00
parent e27656349a
commit 2f8a3eaad6
65 changed files with 481 additions and 482 deletions

View File

@@ -484,21 +484,17 @@ NewPropertyIteratorObject(JSContext *cx, unsigned flags)
if (!shape)
return nullptr;
NativeObject *obj =
MaybeNativeObject(JSObject::create(cx, ITERATOR_FINALIZE_KIND,
GetInitialHeap(GenericObject, clasp), shape, type));
JSObject *obj = JSObject::create(cx, ITERATOR_FINALIZE_KIND,
GetInitialHeap(GenericObject, clasp), shape, type);
if (!obj)
return nullptr;
PropertyIteratorObject *res = &obj->as<PropertyIteratorObject>();
MOZ_ASSERT(obj->numFixedSlots() == JSObject::ITER_CLASS_NFIXED_SLOTS);
return &obj->as<PropertyIteratorObject>();
MOZ_ASSERT(res->numFixedSlots() == JSObject::ITER_CLASS_NFIXED_SLOTS);
return res;
}
JSObject *obj = NewBuiltinClassInstance(cx, &PropertyIteratorObject::class_);
if (!obj)
return nullptr;
return &obj->as<PropertyIteratorObject>();
return NewBuiltinClassInstance<PropertyIteratorObject>(cx);
}
NativeIterator *
@@ -809,7 +805,7 @@ js::CreateItrResultObject(JSContext *cx, HandleValue value, bool done)
if (!proto)
return nullptr;
RootedObject obj(cx, NewObjectWithGivenProto(cx, &JSObject::class_, proto, cx->global()));
RootedPlainObject obj(cx, NewObjectWithGivenProto<PlainObject>(cx, proto, cx->global()));
if (!obj)
return nullptr;