michael@0: // Iterators from another compartment work with their own .next method michael@0: // when called from another compartment, but not with the other michael@0: // compartment's .next method. michael@0: michael@0: // FIXME: 'next' should work cross-realm. Bug 924059. michael@0: michael@0: load(libdir + "asserts.js"); michael@0: load(libdir + "iteration.js"); michael@0: michael@0: var g = newGlobal(); michael@0: g.eval("var it = [1, 2]['" + std_iterator + "']();"); michael@0: assertIteratorNext(g.it, 1); michael@0: assertThrowsInstanceOf([][std_iterator]().next.bind(g.it), TypeError)