mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
Use @callback name if present (fixes #136)
This commit is contained in:
parent
6940c30943
commit
3920fd2279
@ -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) {
|
||||
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user