Debian Codegraph @

js/src/jit-test/tests/for-of/next-3.js

raw
1 // Iterators from another compartment work with both their own .next method
2 // with the other compartment's .next method.
3
4 load(libdir + "asserts.js");
5 load(libdir + "iteration.js");
6
7 var g = newGlobal();
8 g.eval(`var it = [1, 2][Symbol.iterator]();`);
9 assertIteratorNext(g.it, 1);
10 assertDeepEq([][Symbol.iterator]().next.call(g.it), { value: 2, done: false })