Skip to content

Commit

Permalink
sys.js: sys.inspect: show function names
Browse files Browse the repository at this point in the history
  • Loading branch information
xk authored and ry committed Sep 19, 2010
1 parent 1e63cd6 commit 8e246ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

Expand All @@ -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 = "";
}
Expand Down

0 comments on commit 8e246ac

Please sign in to comment.