js/src/jit-test/tests/collections/Array-of-1.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/collections/Array-of-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +// Array.of makes real arrays.
     1.5 +
     1.6 +function check(a) {
     1.7 +    assertEq(Object.getPrototypeOf(a), Array.prototype);
     1.8 +    assertEq(Array.isArray(a), true);
     1.9 +    a[9] = 9;
    1.10 +    assertEq(a.length, 10);
    1.11 +}
    1.12 +
    1.13 +check(Array.of());
    1.14 +check(Array.of(0));
    1.15 +check(Array.of(0, 1, 2));
    1.16 +
    1.17 +var f = Array.of;
    1.18 +check(f());

mercurial