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 2554 additions and 2557 deletions
5107
gen/repl.c
5107
gen/repl.c
File diff suppressed because it is too large
Load diff
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