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

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

mercurial