summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/next-3.js
blob: 529d44dafa7f4b5f0e86985dd45f64a6ca594fff (plain)
1
2
3
4
5
6
7
8
9
10
// Iterators from another compartment work with both their own .next method
// with the other compartment's .next method.

load(libdir + "asserts.js");
load(libdir + "iteration.js");

var g = newGlobal();
g.eval(`var it = [1, 2][Symbol.iterator]();`);
assertIteratorNext(g.it, 1);
assertDeepEq([][Symbol.iterator]().next.call(g.it), { value: 2, done: false })