mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Check for RegExp objects before going the standard object path in REPL
This commit is contained in:
parent
48cb3ac410
commit
dd2427785f
2 changed files with 2 additions and 2 deletions
BIN
gen/repl.c
BIN
gen/repl.c
Binary file not shown.
4
repl.js
4
repl.js
|
@ -942,6 +942,8 @@ import * as os from "os";
|
|||
std.puts("[circular]");
|
||||
} else if (a instanceof Date) {
|
||||
std.puts(`Date ${JSON.stringify(a.toGMTString())}`);
|
||||
} else if (a instanceof RegExp) {
|
||||
std.puts(a.toString());
|
||||
} else {
|
||||
stack.push(a);
|
||||
if (Array.isArray(a)) {
|
||||
|
@ -961,8 +963,6 @@ import * as os from "os";
|
|||
}
|
||||
}
|
||||
std.puts(" ]");
|
||||
} else if (a instanceof RegExp) {
|
||||
std.puts(a.toString());
|
||||
} else {
|
||||
keys = Object.keys(a);
|
||||
n = keys.length;
|
||||
|
|
Loading…
Reference in a new issue