summaryrefslogtreecommitdiff
path: root/ext/console/02_console.js
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-03-21 13:12:13 +0900
committerGitHub <noreply@github.com>2023-03-21 13:12:13 +0900
commit896d7f02cb284ad3a05299218dd849685cd33390 (patch)
tree490c05d39930e1bfe7a097851bb55a6ddaef540b /ext/console/02_console.js
parent4c34a2f2df595fa43b3eb06722c3ad742450d8bd (diff)
chore(ext/console): inspect anonymous function as `[Function (anonymous)]` (#18283)
This PR changes the inspect result of anonymous functions from `[Function]` to `[Function (anonymous)]`. This behavior is aligned to `util.inspect` of Node.js.
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r--ext/console/02_console.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index faea692af..f82057771 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -390,7 +390,7 @@ function inspectFunction(value, inspectOptions) {
// from MDN spec
return cyan(`${refStr}[${cstrName}: ${value.name}]`) + suffix;
}
- return cyan(`${refStr}[${cstrName}]`) + suffix;
+ return cyan(`${refStr}[${cstrName} (anonymous)]`) + suffix;
}
function inspectIterable(