mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
make the exports tag work correctly when combined with the enum tag (#970)
This commit is contained in:
parent
599a376cb5
commit
1c99ec39eb
@ -415,7 +415,7 @@ var baseTags = exports.baseTags = {
|
|||||||
enum: {
|
enum: {
|
||||||
canHaveType: true,
|
canHaveType: true,
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
doclet.kind = 'member';
|
doclet.kind = doclet.kind || 'member';
|
||||||
doclet.isEnum = true;
|
doclet.isEnum = true;
|
||||||
setDocletTypeToValueType(doclet, tag);
|
setDocletTypeToValueType(doclet, tag);
|
||||||
}
|
}
|
||||||
|
|||||||
11
test/fixtures/enumtag3.js
vendored
Normal file
11
test/fixtures/enumtag3.js
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
define(function () {
|
||||||
|
/**
|
||||||
|
* @exports mymodule
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
var exports = {
|
||||||
|
A: 'abc'
|
||||||
|
};
|
||||||
|
|
||||||
|
return exports;
|
||||||
|
});
|
||||||
@ -59,4 +59,13 @@ describe('@enum tag', function() {
|
|||||||
expect(pentaState.properties.length).toBe(5);
|
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');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user