Bug 1107496 - Add PlainObject subclass, r=luke.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user