diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2020-05-22 15:02:04 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-05-30 05:19:27 +0300 |
commit | 4bdab881b8cdfdc53e90267e549ff2c8b9ab310b (patch) | |
tree | 381d601b68575726f9d92a9e41948dc1edf5979d /lib/internal/util | |
parent | 87629d7e7c793fe4b452e6818c2b033d07ce1f44 (diff) |
console: name console functions appropriately
The current name of most of the global console functions is
"bound consoleCall". This is changed to the actual functions name
e.g., "log" or "error".
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: https://github.com/nodejs/node/pull/33524
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'lib/internal/util')
-rw-r--r-- | lib/internal/util/inspector.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 5a95bcf8ea8..8d413b116fd 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -1,6 +1,7 @@ 'use strict'; const { + ObjectDefineProperty, ObjectKeys, } = primordials; @@ -42,6 +43,9 @@ function wrapConsole(consoleFromNode, consoleFromVM) { consoleFromNode[key] = consoleCall.bind(consoleFromNode, consoleFromVM[key], consoleFromNode[key]); + ObjectDefineProperty(consoleFromNode[key], 'name', { + value: key + }); } else { // Add additional console APIs from the inspector consoleFromNode[key] = consoleFromVM[key]; |