Bug 892225 - backout changeset b4426d926b31.

This commit is contained in:
Ms2ger 2013-07-23 17:34:57 +02:00
parent c1cd226370
commit 523e108d2b
2 changed files with 1 additions and 12 deletions

View File

@ -1,4 +0,0 @@
// Array.prototype.iterator is the same function object as .values.
assertEq(Array.prototype.values, Array.prototype.iterator);
assertEq(Array.prototype.iterator.name, "values");

View File

@ -2820,6 +2820,7 @@ static const JSFunctionSpec array_methods[] = {
{"find", {NULL, NULL}, 1,0, "ArrayFind"},
{"findIndex", {NULL, NULL}, 1,0, "ArrayFindIndex"},
JS_FN("iterator", JS_ArrayIterator, 0,0),
JS_FS_END
};
@ -2950,14 +2951,6 @@ js_InitArrayClass(JSContext *cx, HandleObject obj)
if (!DefineConstructorAndPrototype(cx, global, JSProto_Array, ctor, arrayProto))
return NULL;
JSFunction *fun = JS_DefineFunction(cx, arrayProto, "values", JS_ArrayIterator, 0, 0);
if (!fun)
return NULL;
RootedValue funval(cx, ObjectValue(*fun));
if (!JS_DefineProperty(cx, arrayProto, "iterator", funval, NULL, NULL, 0))
return NULL;
return arrayProto;
}