mirror of
https://github.com/bellard/quickjs.git
synced 2024-11-22 21:58:12 +08:00
show readable representation of Date objects in repl
This commit is contained in:
parent
27928ce491
commit
6428ce0c8b
2
repl.js
2
repl.js
@ -1005,6 +1005,8 @@ import * as os from "os";
|
|||||||
std.puts(a);
|
std.puts(a);
|
||||||
} else if (stack.indexOf(a) >= 0) {
|
} else if (stack.indexOf(a) >= 0) {
|
||||||
std.puts("[circular]");
|
std.puts("[circular]");
|
||||||
|
} else if (a instanceof Date) {
|
||||||
|
std.puts("Date " + a.toGMTString().__quote());
|
||||||
} else if (has_jscalc && (a instanceof Fraction ||
|
} else if (has_jscalc && (a instanceof Fraction ||
|
||||||
a instanceof Complex ||
|
a instanceof Complex ||
|
||||||
a instanceof Mod ||
|
a instanceof Mod ||
|
||||||
|
Loading…
Reference in New Issue
Block a user