minor cleanup

This commit is contained in:
Jeff Williams 2014-12-07 13:01:31 -08:00
parent 5fa636ab7b
commit c0b7b784a2

View File

@ -7,7 +7,7 @@
*/
'use strict';
var hasOwnProp = Object.prototype.hasOwnProperty;
var _ = require('underscore');
var jsdoc = {
name: require('jsdoc/name'),
src: {
@ -24,6 +24,8 @@ var jsdoc = {
var path = require('jsdoc/path');
var Syntax = require('jsdoc/src/syntax').Syntax;
var hasOwnProp = Object.prototype.hasOwnProperty;
var DEFINITIONS = {
closure: 'closureTags',
jsdoc: 'jsdocTags'
@ -31,11 +33,11 @@ var DEFINITIONS = {
var NAMESPACES = jsdoc.name.NAMESPACES;
// Clone a tag definition, excluding synonyms.
function cloneTagDef(tagDef) {
function cloneTagDef(tagDef, extras) {
var newTagDef = jsdoc.util.doop(tagDef);
delete newTagDef.synonyms;
return newTagDef;
return (extras ? _.extend(newTagDef, extras) : newTagDef);
}
function getSourcePaths() {
@ -88,7 +90,7 @@ function setDocletScopeToTitle(doclet, tag) {
function setDocletNameToValue(doclet, tag) {
if (tag.value && tag.value.description) { // as in a long tag
doclet.addTag( 'name', tag.value.description);
doclet.addTag('name', tag.value.description);
}
else if (tag.text) { // or a short tag
doclet.addTag('name', tag.text);
@ -103,7 +105,7 @@ function setDocletNameToValueName(doclet, tag) {
function setDocletDescriptionToValue(doclet, tag) {
if (tag.value) {
doclet.addTag( 'description', tag.value );
doclet.addTag('description', tag.value);
}
}
@ -804,11 +806,9 @@ var closureTags = exports.closureTags = {
return: cloneTagDef(baseTags.returns),
'this': cloneTagDef(baseTags['this']),
throws: cloneTagDef(baseTags.throws),
type: (function() {
var tagDef = cloneTagDef(baseTags.type);
tagDef.mustNotHaveDescription = false;
return tagDef;
})(),
type: cloneTagDef(baseTags.type, {
mustNotHaveDescription: false
}),
typedef: cloneTagDef(baseTags.typedef)
};