Debian Codegraph @

js/src/jit-test/tests/for-of/array-iterator-surfaces-1.js

raw
1 // Superficial tests of the Array.prototype[@@iterator] builtin function and its workalikes.
2
3 load(libdir + "iteration.js");
4
5 var constructors = [Array, String, Uint8Array, Uint8ClampedArray];
6 for (var c of constructors) {
7 assertEq(c.prototype[Symbol.iterator].length, 0);
8
9 var loc = (c === Array || c === String)
10 ? c.prototype
11 : Object.getPrototypeOf(c.prototype);
12
13 var desc = Object.getOwnPropertyDescriptor(loc, Symbol.iterator);
14 assertEq(desc.configurable, true);
15 assertEq(desc.enumerable, false);
16 assertEq(desc.writable, true);
17 }