Skip to content

Commit

Permalink
support the record tag (Closure Compiler only) (jsdoc#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Jul 17, 2017
1 parent b13bb67 commit 7afa146
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/jsdoc/tag/dictionary/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,9 @@ exports.closureTags = {
inheritdoc: cloneTagDef(baseTags.inheritdoc),
interface: cloneTagDef(baseTags.interface, {
canHaveName: false,
mustNotHaveValue: true
mustNotHaveValue: true,
// Closure Compiler only
synonyms: ['record']
}),
lends: cloneTagDef(baseTags.lends),
license: cloneTagDef(baseTags.license),
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/interfacetag3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* My structural interface.
*
* @record
*/
function MyStructuralInterface() {}
18 changes: 18 additions & 0 deletions test/specs/tags/interfacetag.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,22 @@ describe('@interface tag', function() {
expect(virtualInterface).not.toBeDefined();
});
});

describe('Closure Compiler tags', function() {
afterEach(function() {
jasmine.restoreTagDictionary();
});

it('should support @record as a synonym for @interface', function() {
var docSet2;
var myStructuralInterface;

jasmine.replaceTagDictionary('closure');

docSet2 = jasmine.getDocSetFromFile('test/fixtures/interfacetag3.js');
myStructuralInterface = docSet2.getByLongname('MyStructuralInterface')[0];

expect(myStructuralInterface.kind).toBe('interface');
});
});
});

0 comments on commit 7afa146

Please sign in to comment.