mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
sys.js: sys.inspect: show function names
This commit is contained in:
1 parent
f6f739b3a2
commit
01035714a5
1 file changed
+2
-2
+2
-2
@@ -119,7 +119,7 @@ exports.inspect = function (obj, showHidden, depth, colors) {
|
||||
if (isRegExp(value)) {
|
||||
return stylize('' + value, 'regexp');
|
||||
} else {
|
||||
return stylize('[Function]', 'special');
|
||||
return stylize('[Function'+ (value.name ? ': '+ value.name : '')+ ']', 'special');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ exports.inspect = function (obj, showHidden, depth, colors) {
|
||||
|
||||
// Make functions say that they are functions
|
||||
if (typeof value === 'function') {
|
||||
base = (isRegExp(value)) ? ' ' + value : ' [Function]';
|
||||
base = (isRegExp(value)) ? ' ' + value : ' [Function'+ (value.name ? ': '+ value.name : '')+ ']';
|
||||
} else {
|
||||
base = "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user