js/src/tests/js1_8_5/regress/regress-620376-1.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_5/regress/regress-620376-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +// |reftest| skip-if(Android)
     1.5 +/*
     1.6 + * Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/licenses/publicdomain/
     1.8 + * Contributors: Igor Bukanov
     1.9 + */
    1.10 +
    1.11 +// Test that we can terminate looping array enumeration
    1.12 +function test() {
    1.13 +    if (typeof timeout != "function")
    1.14 +	return;
    1.15 +
    1.16 +    var p = Proxy.create({ enumerate: function() { return Array(1e9); }});
    1.17 +
    1.18 +    expectExitCode(6);
    1.19 +    timeout(0.001);
    1.20 +
    1.21 +    var n = 0;
    1.22 +    for (i in p) { ++n;}
    1.23 +    return n;
    1.24 +}
    1.25 +
    1.26 +test();
    1.27 +reportCompare(0, 0, "ok");

mercurial