make the exports tag work correctly when combined with the enum tag (#970)

This commit is contained in:
Jeff Williams 2017-07-22 20:29:56 -07:00
parent 599a376cb5
commit 1c99ec39eb
3 changed files with 21 additions and 1 deletions

View File

@ -415,7 +415,7 @@ var baseTags = exports.baseTags = {
enum: {
canHaveType: true,
onTagged: function(doclet, tag) {
doclet.kind = 'member';
doclet.kind = doclet.kind || 'member';
doclet.isEnum = true;
setDocletTypeToValueType(doclet, tag);
}

11
test/fixtures/enumtag3.js vendored Normal file
View File

@ -0,0 +1,11 @@
define(function () {
/**
* @exports mymodule
* @enum {string}
*/
var exports = {
A: 'abc'
};
return exports;
});

View File

@ -59,4 +59,13 @@ describe('@enum tag', function() {
expect(pentaState.properties.length).toBe(5);
});
});
describe('combined with @exports tag', function() {
var docSet3 = jasmine.getDocSetFromFile('test/fixtures/enumtag3.js');
var mymodule = docSet3.getByLongname('module:mymodule')[0];
it('When a symbol has both an @exports tag and an @enum tag, its kind is set to `module`', function() {
expect(mymodule.kind).toBe('module');
});
});
});