mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
cleanup
This commit is contained in:
parent
7ef13bf40b
commit
277d712f3e
@ -146,6 +146,11 @@ function setDocletNameToFilename(doclet, tag) {
|
||||
doclet.name = name;
|
||||
}
|
||||
|
||||
function parseTypeText(text) {
|
||||
var tagType = jsdoc.tag.type.parse(text, false, true);
|
||||
return tagType.typeExpression || text;
|
||||
}
|
||||
|
||||
function parseBorrows(doclet, tag) {
|
||||
var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text);
|
||||
if (m) {
|
||||
@ -222,11 +227,7 @@ exports.defineTags = function(dictionary) {
|
||||
dictionary.defineTag('augments', {
|
||||
mustHaveValue: true,
|
||||
// Allow augments value to be specified as a normal type, e.g. {Type}
|
||||
onTagText: function(text) {
|
||||
|
||||
var tagType = jsdoc.tag.type.parse(text, false, true);
|
||||
return tagType.typeExpression || text;
|
||||
},
|
||||
onTagText: parseTypeText,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.augment( firstWordOf(tag.value) );
|
||||
}
|
||||
@ -268,26 +269,6 @@ exports.defineTags = function(dictionary) {
|
||||
})
|
||||
.synonym('constructor');
|
||||
|
||||
dictionary.defineTag('interface', {
|
||||
mustNotHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.addTag('kind', 'interface');
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('implements', {
|
||||
mustHaveValue: true,
|
||||
onTagText: function(text) {
|
||||
return text.replace(/(^\{|\}$)/g, '');
|
||||
},
|
||||
onTagged: function(doclet, tag) {
|
||||
if (!doclet.implements) {
|
||||
doclet.implements = [];
|
||||
}
|
||||
doclet.implements.push(tag.value);
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('classdesc', {
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.classdesc = tag.value;
|
||||
@ -487,6 +468,24 @@ exports.defineTags = function(dictionary) {
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('implements', {
|
||||
mustHaveValue: true,
|
||||
onTagText: parseTypeText,
|
||||
onTagged: function(doclet, tag) {
|
||||
if (!doclet.implements) {
|
||||
doclet.implements = [];
|
||||
}
|
||||
doclet.implements.push(tag.value);
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('interface', {
|
||||
mustNotHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.addTag('kind', 'interface');
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('kind', {
|
||||
mustHaveValue: true
|
||||
});
|
||||
|
||||
2
test/fixtures/interface-implements.js
vendored
2
test/fixtures/interface-implements.js
vendored
@ -54,6 +54,7 @@ MyTester.prototype.it = function() {};
|
||||
* @interface
|
||||
*/
|
||||
function IWorker() {}
|
||||
/** Interface for doing some work. */
|
||||
IWorker.prototype.work = function() {};
|
||||
|
||||
/**
|
||||
@ -61,6 +62,7 @@ IWorker.prototype.work = function() {};
|
||||
* @implements {IWorker}
|
||||
*/
|
||||
function MyWorker() {}
|
||||
/** Do some work. */
|
||||
MyWorker.prototype.work = function() {};
|
||||
MyWorker.prototype.process = function() {};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user