diff --git a/streams/infer/name.js b/streams/infer/name.js index 207b3bb..95c6392 100644 --- a/streams/infer/name.js +++ b/streams/infer/name.js @@ -20,12 +20,13 @@ module.exports = function inferName() { return callback(null, comment); } - // If this comment has a @class, @event, or @typedef tag with a name, - // use it. + // If this comment has a @class, @event, @typedef, or @callback + // tag with a name, use it. var explicitNameTags = { 'class': 'name', 'event': 'description', - 'typedef': 'description' + 'typedef': 'description', + 'callback': 'description' }; for (var title in explicitNameTags) { diff --git a/test/streams/infer_name.js b/test/streams/infer_name.js index 373b502..113abab 100644 --- a/test/streams/infer_name.js +++ b/test/streams/infer_name.js @@ -144,3 +144,14 @@ test('inferName - typedef', function (t) { t.end(); }); }); + +test('inferName - callback', function (t) { + evaluate(function () { + /** @callback explicitCallback */ + function implicitName() {} + return implicitName; + }, function (result) { + t.equal(result[ 0 ].name, 'explicitCallback'); + t.end(); + }); +});