Skip to content

Commit 81ebdd4

Browse files
committed
[patch] indicate explicitly that anon functions are anonymous, to match node
1 parent b3995cb commit 81ebdd4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
7878

7979
if (typeof obj === 'function') {
8080
var name = nameOf(obj);
81-
return '[Function' + (name ? ': ' + name : '') + ']';
81+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']';
8282
}
8383
if (isSymbol(obj)) {
8484
var symString = Symbol.prototype.toString.call(obj);

test/fn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('anon function', function (t) {
2222
return function () {};
2323
}());
2424
var obj = [1, 2, f, 4];
25-
t.equal(inspect(obj), '[ 1, 2, [Function], 4 ]');
25+
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]');
2626

2727
t.end();
2828
});

0 commit comments

Comments
 (0)