js/src/jit-test/tests/for-of/array-iterator-null.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-null.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,11 @@
     1.4 +// Array.prototype.iterator applied to undefined or null throws directly.
     1.5 +
     1.6 +load(libdir + "asserts.js");
     1.7 +load(libdir + "iteration.js");
     1.8 +
     1.9 +for (var v of [undefined, null]) {
    1.10 +    // ES6 draft 2013-09-05 section 22.1.5.1.
    1.11 +    assertThrowsInstanceOf(function () { Array.prototype[std_iterator].call(v); }, TypeError);
    1.12 +    assertThrowsInstanceOf(function () { Array.prototype.keys.call(v); }, TypeError);
    1.13 +    assertThrowsInstanceOf(function () { Array.prototype.entries.call(v); }, TypeError);
    1.14 +}

mercurial