mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 21:35:10 +00:00
16 lines
340 B
JavaScript
16 lines
340 B
JavaScript
function assert(x) { if (!x) throw 1; }
|
|
|
|
try {
|
|
assert(Array.length === 1);
|
|
assert(Array.prototype.length === 0);
|
|
assert(typeof Array() === "object");
|
|
assert(typeof new Array() === "object");
|
|
|
|
x = new Array(5);
|
|
|
|
assert(x.length === 5);
|
|
|
|
console.log("PASS");
|
|
} catch (e) {
|
|
console.log("FAIL: " + e.message);
|
|
}
|