Backed out changeset dc265cc31095 (bug 1091900)

This commit is contained in:
Carsten "Tomcat" Book
2014-11-06 09:11:18 +01:00
parent 6e4debec97
commit 77157c3f45
14 changed files with 138 additions and 6 deletions

View File

@@ -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 {