mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
support the unrestricted tag (Closure Compiler only) (#605)
This commit is contained in:
parent
25a271e727
commit
2164532d30
@ -983,7 +983,11 @@ exports.closureTags = {
|
||||
type: cloneTagDef(baseTags.type, {
|
||||
mustNotHaveDescription: false
|
||||
}),
|
||||
typedef: cloneTagDef(baseTags.typedef)
|
||||
typedef: cloneTagDef(baseTags.typedef),
|
||||
// Closure Compiler only
|
||||
unrestricted: {
|
||||
onTagged: ignore
|
||||
}
|
||||
};
|
||||
|
||||
function addTagDefinitions(dictionary, tagDefs) {
|
||||
|
||||
7
test/fixtures/unrestrictedtag.js
vendored
Normal file
7
test/fixtures/unrestrictedtag.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* My class.
|
||||
*
|
||||
* @constructor
|
||||
* @unrestricted
|
||||
*/
|
||||
function Foo() {}
|
||||
42
test/specs/tags/unrestrictedtag.js
Normal file
42
test/specs/tags/unrestrictedtag.js
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
describe('@unrestricted tag', function() {
|
||||
var env = require('jsdoc/env');
|
||||
var logger = require('jsdoc/util/logger');
|
||||
|
||||
var allowUnknownTags = Boolean(env.conf.tags.allowUnknownTags);
|
||||
|
||||
beforeEach(function() {
|
||||
env.conf.tags.allowUnknownTags = false;
|
||||
spyOn(logger, 'error');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
jasmine.restoreTagDictionary();
|
||||
env.conf.tags.allowUnknownTags = allowUnknownTags;
|
||||
});
|
||||
|
||||
describe('JSDoc tags', function() {
|
||||
beforeEach(function() {
|
||||
jasmine.replaceTagDictionary('jsdoc');
|
||||
});
|
||||
|
||||
it('should not recognize the @unrestricted tag', function() {
|
||||
jasmine.getDocSetFromFile('test/fixtures/unrestrictedtag.js');
|
||||
|
||||
expect(logger.error).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Closure Compiler tags', function() {
|
||||
beforeEach(function() {
|
||||
jasmine.replaceTagDictionary('closure');
|
||||
});
|
||||
|
||||
it('should recognize the @unrestricted tag', function() {
|
||||
jasmine.getDocSetFromFile('test/fixtures/unrestrictedtag.js');
|
||||
|
||||
expect(logger.error).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user