Members of an @enum no longer require doc comments to appear in the documentation.

This commit is contained in:
Michael Mathews 2011-10-26 23:50:57 +01:00
parent 1abe982e2f
commit 2351776bdf
4 changed files with 8 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -5,7 +5,6 @@
var TriState = {
/** true */
TRUE: 1,
/** false */
FALSE: -1,
/** @type {boolean} */
MAYBE: true

View File

@ -1,5 +1,6 @@
/**
* @overview This is a file doclet.
* @copyright Michael Mathews 2011
*/
function ignoreMe() {

View File

@ -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');
});