summaryrefslogtreecommitdiff
path: root/cli/rt/02_console.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/rt/02_console.js')
-rw-r--r--cli/rt/02_console.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/rt/02_console.js b/cli/rt/02_console.js
index 0b5931616..ab91ffc09 100644
--- a/cli/rt/02_console.js
+++ b/cli/rt/02_console.js
@@ -193,6 +193,11 @@
}
function inspectFunction(value, _ctx) {
+ if (customInspect in value && typeof value[customInspect] === "function") {
+ try {
+ return String(value[customInspect]());
+ } catch {}
+ }
// Might be Function/AsyncFunction/GeneratorFunction
const cstrName = Object.getPrototypeOf(value).constructor.name;
if (value.name && value.name !== "anonymous") {