diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/for-of/next-3.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/for-of/next-3.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,13 @@ +// Iterators from another compartment work with their own .next method +// when called from another compartment, but not with the other +// compartment's .next method. + +// FIXME: 'next' should work cross-realm. Bug 924059. + +load(libdir + "asserts.js"); +load(libdir + "iteration.js"); + +var g = newGlobal(); +g.eval("var it = [1, 2]['" + std_iterator + "']();"); +assertIteratorNext(g.it, 1); +assertThrowsInstanceOf([][std_iterator]().next.bind(g.it), TypeError)