js/src/jit-test/tests/for-of/array-iterator-gc.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/array-iterator-gc.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,13 @@
     1.4 +// Array iterators keep the underlying array, arraylike object, or string alive.
     1.5 +
     1.6 +load(libdir + "referencesVia.js");
     1.7 +load(libdir + "iteration.js");
     1.8 +
     1.9 +function test(obj) {
    1.10 +    var it = Array.prototype[std_iterator].call(obj);
    1.11 +    assertEq(referencesVia(it, "**UNKNOWN SLOT 0**", obj), true);
    1.12 +}
    1.13 +
    1.14 +test([]);
    1.15 +test([1, 2, 3, 4]);
    1.16 +test({});

mercurial