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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7a25c7c2d318
1 // Check superficial features of Array.of.
2
3 load(libdir + "asserts.js");
4
5 var desc = Object.getOwnPropertyDescriptor(Array, "of");
6 assertEq(desc.configurable, true);
7 assertEq(desc.enumerable, false);
8 assertEq(desc.writable, true);
9 assertEq(Array.of.length, 0);
10 assertThrowsInstanceOf(() => new Array.of(), TypeError); // not a constructor
11
12 // When the this-value passed in is not a constructor, the result is an array.
13 for (let v of [undefined, null, false, "cow"])
14 assertEq(Array.isArray(Array.of.call(v)), true);

mercurial