sys.js: sys.inspect: show function names
This commit is contained in:
parent
1e63cd69f8
commit
8e246acd0e
@ -119,7 +119,7 @@ exports.inspect = function (obj, showHidden, depth, colors) {
|
|||||||
if (isRegExp(value)) {
|
if (isRegExp(value)) {
|
||||||
return stylize('' + value, 'regexp');
|
return stylize('' + value, 'regexp');
|
||||||
} else {
|
} 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
|
// Make functions say that they are functions
|
||||||
if (typeof value === 'function') {
|
if (typeof value === 'function') {
|
||||||
base = (isRegExp(value)) ? ' ' + value : ' [Function]';
|
base = (isRegExp(value)) ? ' ' + value : ' [Function'+ (value.name ? ': '+ value.name : '')+ ']';
|
||||||
} else {
|
} else {
|
||||||
base = "";
|
base = "";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user