Skip to content

Commit

Permalink
Members of an @enum no longer require doc comments to appear in the d…
Browse files Browse the repository at this point in the history
…ocumentation.
  • Loading branch information
micmath committed Oct 26, 2011
1 parent 1abe982 commit 2351776
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions rhino_modules/jsdoc/src/parser.js
Expand Up @@ -318,6 +318,7 @@ function visitNode(node) {
if (!parent.doclet.properties) { parent.doclet.properties = []; }
// members of an enum inherit the enum's type
if (parent.doclet.type && !e.doclet.type) { e.doclet.type = parent.doclet.type; }
delete e.doclet.undocumented;
parent.doclet.properties.push(e.doclet);
}
}
Expand Down
1 change: 0 additions & 1 deletion test/cases/enumtag.js
Expand Up @@ -5,7 +5,6 @@
var TriState = {
/** true */
TRUE: 1,
/** false */
FALSE: -1,
/** @type {boolean} */
MAYBE: true
Expand Down
1 change: 1 addition & 0 deletions test/cases/file.js
@@ -1,5 +1,6 @@
/**
* @overview This is a file doclet.
* @copyright Michael Mathews 2011
*/

function ignoreMe() {
Expand Down
6 changes: 6 additions & 0 deletions test/t/cases/enumtag.js
Expand Up @@ -12,6 +12,12 @@
assert.equal(tristate.properties[0].type.names.join(', '), 'number');
});

test('If no no comment is given for the property it is still included in the enum.', function() {
assert.equal(tristate.properties[1].longname, 'TriState.FALSE');
assert.equal(typeof tristate.properties[1].undocumented, 'undefined');

});

test('If a @type is given for the property it is reflected in the property value.', function() {
assert.equal(tristate.properties[2].type.names.join(', '), 'boolean');
});
Expand Down

0 comments on commit 2351776

Please sign in to comment.