Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // Check superficial features of Array.of.
3 load(libdir + "asserts.js");
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
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);