diff --git a/modules/jsdoc/doclet.js b/modules/jsdoc/doclet.js index 85fdbfbb..a9743e4b 100644 --- a/modules/jsdoc/doclet.js +++ b/modules/jsdoc/doclet.js @@ -20,9 +20,8 @@ exports.Doclet = function (docletSrc, meta) { var newTags = []; - this.src = docletSrc; + this.comment = docletSrc; addMeta.call(this, meta); - this.tags = []; docletSrc = unwrap(docletSrc); docletSrc = fixDescription(docletSrc); @@ -63,12 +62,12 @@ var tagDef = jsdoc.tag.dictionary.lookUp(title), newTag = new jsdoc.tag.Tag(title, text, this.meta); - if (tagDef.onTagged) { - if (tagDef.onTagged(this, newTag) !== false) { // onTagged handler prevents tag being added bt returning false - this.tags.push(newTag); - } + if (tagDef && tagDef.onTagged) { + tagDef.onTagged(this, newTag) } - else { + + if (!tagDef) { + this.tags = this.tags || []; this.tags.push(newTag); } diff --git a/modules/jsdoc/src/parser.js b/modules/jsdoc/src/parser.js index 72f432ac..0519be56 100644 --- a/modules/jsdoc/src/parser.js +++ b/modules/jsdoc/src/parser.js @@ -211,7 +211,7 @@ else if (node.type === Token.ASSIGN) { e = { id: 'astnode'+node.hashCode(), // the id of the ASSIGN node - comment: String(node.jsDoc||'@undocumented'), // document that it is undocumented :) + comment: String(node.jsDoc||'@undocumented'), lineno: node.getLineno(), filename: currentSourceName, astnode: node, diff --git a/modules/jsdoc/tag/dictionary/definitions.js b/modules/jsdoc/tag/dictionary/definitions.js index bcf9a467..92100260 100644 --- a/modules/jsdoc/tag/dictionary/definitions.js +++ b/modules/jsdoc/tag/dictionary/definitions.js @@ -411,6 +411,7 @@ mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.undocumented = true; + doclet.comment = ''; return false; } diff --git a/test/t/cases/var.js b/test/t/cases/var.js index dc079367..0524da08 100644 --- a/test/t/cases/var.js +++ b/test/t/cases/var.js @@ -12,7 +12,7 @@ test('When a series of constants are documented.', function() { assert.equal(found[0].length, 1, 'The first constant should be found'); - assert.equal(found[0][0].src, '/** document me */', 'The first constant should get the docs.'); + assert.equal(found[0][0].comment, '/** document me */', 'The first constant should get the docs.'); assert.equal(found[0][0].name, 'GREEN', 'The short name should be correct.'); assert.equal(found[0][0].memberof, undefined, 'The memberof should be undefined.'); assert.equal(found[0][0].scope, undefined, 'The scope should be undefined.'); @@ -22,7 +22,7 @@ }); test('When member of a series of vars are documented.', function() { - assert.equal(found[4][0].src, '/** document me */', 'The correct var should get the docs.'); + assert.equal(found[4][0].comment, '/** document me */', 'The correct var should get the docs.'); assert.equal(found[4][0].name, 'results', 'The short name should be correct.'); assert.equal(found[4][0].memberof, undefined, 'The memberof should be undefined.'); assert.equal(found[4][0].scope, undefined, 'The scope should be undefined.');