mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 13:15:06 +00:00

This adds: - A global Date object (with `length` property and `now` function) - The Date constructor (no arguments yet) - The Date prototype (with `get*` functions)
15 lines
323 B
JavaScript
15 lines
323 B
JavaScript
function assert(x) { if (!x) throw 1; }
|
|
|
|
try {
|
|
var last = 0;
|
|
for (var i = 0; i < 100; ++i) {
|
|
var now = Date.now();
|
|
assert(!isNaN(now))
|
|
assert(now > 1580000000000);
|
|
assert(now >= last);
|
|
last = now;
|
|
}
|
|
console.log("PASS");
|
|
} catch (e) {
|
|
console.log("FAIL: " + e);
|
|
}
|