Backed out changeset dc265cc31095 (bug 1091900)
This commit is contained in:
@@ -666,8 +666,11 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa
|
||||
bool keysOnly = (flags == JSITER_ENUMERATE);
|
||||
|
||||
if (obj) {
|
||||
if (obj->is<PropertyIteratorObject>() || obj->is<LegacyGeneratorObject>()) {
|
||||
vp.setObject(*obj);
|
||||
if (JSIteratorOp op = obj->getClass()->ext.iteratorObject) {
|
||||
JSObject *iterobj = op(cx, obj, !(flags & JSITER_FOREACH));
|
||||
if (!iterobj)
|
||||
return false;
|
||||
vp.setObject(*iterobj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -888,6 +891,12 @@ static const JSFunctionSpec iterator_methods[] = {
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
static JSObject *
|
||||
iterator_iteratorObject(JSContext *cx, HandleObject obj, bool keysonly)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
|
||||
size_t
|
||||
PropertyIteratorObject::sizeOfMisc(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
@@ -926,6 +935,12 @@ const Class PropertyIteratorObject::class_ = {
|
||||
nullptr, /* hasInstance */
|
||||
nullptr, /* construct */
|
||||
trace,
|
||||
JS_NULL_CLASS_SPEC,
|
||||
{
|
||||
nullptr, /* outerObject */
|
||||
nullptr, /* innerObject */
|
||||
iterator_iteratorObject,
|
||||
}
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
Reference in New Issue
Block a user