From 8e246acd0e80d35356be6c592289487549a49300 Mon Sep 17 00:00:00 2001 From: Jorge Chamorro Bieling Date: Sun, 19 Sep 2010 21:54:41 +0200 Subject: [PATCH] sys.js: sys.inspect: show function names --- lib/sys.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sys.js b/lib/sys.js index 1054c307c3..0c027f5d32 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -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 = ""; }