diff options
author | Charlie Gordon <github@chqrlie.org> | 2024-02-25 22:53:29 +0100 |
---|---|---|
committer | Charlie Gordon <github@chqrlie.org> | 2024-02-25 22:53:29 +0100 |
commit | 6428ce0c8b6f691dbd26c7fe7f11396fdd364d25 (patch) | |
tree | e7abefd837e408072090397dbe5d84cae0a89af1 | |
parent | 27928ce49170a17170bb01649fc27624c0494b05 (diff) | |
download | quickjs-6428ce0c8b6f691dbd26c7fe7f11396fdd364d25.tar.gz quickjs-6428ce0c8b6f691dbd26c7fe7f11396fdd364d25.zip |
show readable representation of Date objects in repl
-rw-r--r-- | repl.js | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1005,6 +1005,8 @@ import * as os from "os"; std.puts(a); } else if (stack.indexOf(a) >= 0) { std.puts("[circular]"); + } else if (a instanceof Date) { + std.puts("Date " + a.toGMTString().__quote()); } else if (has_jscalc && (a instanceof Fraction || a instanceof Complex || a instanceof Mod || |