mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
JSDoc will recognise documented inner members of JS modules. Closes #27.
This commit is contained in:
parent
29fb1c069a
commit
ed40b7bb27
@ -94,6 +94,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (memberofName) { newDoclet.addTag( 'memberof', memberofName); }
|
if (memberofName) { newDoclet.addTag( 'memberof', memberofName); }
|
||||||
|
else {
|
||||||
|
if (currentModule) {
|
||||||
|
if (!newDoclet.scope) newDoclet.addTag( 'inner');
|
||||||
|
if (!newDoclet.memberof && newDoclet.scope !== 'global') newDoclet.addTag( 'memberof', currentModule);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newDoclet.postProcess();
|
newDoclet.postProcess();
|
||||||
|
|||||||
@ -416,6 +416,12 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dictionary.defineTag('static', {
|
||||||
|
onTagged: function(doclet, tag) {
|
||||||
|
setDocletScopeToTitle(doclet, tag);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
dictionary.defineTag('summary', {
|
dictionary.defineTag('summary', {
|
||||||
mustHaveValue: true,
|
mustHaveValue: true,
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
|
|||||||
28
test/cases/moduleinner.js
Normal file
28
test/cases/moduleinner.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* @module my/module
|
||||||
|
*/
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
/** document fooIn */
|
||||||
|
fooIn = function() {
|
||||||
|
};
|
||||||
|
|
||||||
|
/** @namespace */
|
||||||
|
bar = {
|
||||||
|
/** document bar.Zop */
|
||||||
|
zop: function() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @constructor */
|
||||||
|
exports.Frotz = function() {
|
||||||
|
/** document exports.Frotz#quaz */
|
||||||
|
this.quaz = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}) ();
|
||||||
|
|
||||||
|
/** document fooOut
|
||||||
|
*/
|
||||||
|
fooOut = function() {
|
||||||
|
};
|
||||||
@ -125,6 +125,7 @@ testFile('test/t/cases/ignoretag.js');
|
|||||||
testFile('test/t/cases/lends.js');
|
testFile('test/t/cases/lends.js');
|
||||||
testFile('test/t/cases/lends2.js');
|
testFile('test/t/cases/lends2.js');
|
||||||
testFile('test/t/cases/lendsglobal.js');
|
testFile('test/t/cases/lendsglobal.js');
|
||||||
|
testFile('test/t/cases/moduleinner.js');
|
||||||
testFile('test/t/cases/memberoftag.js');
|
testFile('test/t/cases/memberoftag.js');
|
||||||
testFile('test/t/cases/memberoftag2.js');
|
testFile('test/t/cases/memberoftag2.js');
|
||||||
testFile('test/t/cases/moduletag.js');
|
testFile('test/t/cases/moduletag.js');
|
||||||
|
|||||||
14
test/t/cases/moduleinner.js
Normal file
14
test/t/cases/moduleinner.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
(function() {
|
||||||
|
var docSet = testhelpers.getDocSetFromFile('test/cases/moduleinner.js'),
|
||||||
|
fooIn = docSet.getByLongname('module:my/module~fooIn')[0],
|
||||||
|
fooOut = docSet.getByLongname('module:my/module~fooOut')[0];;
|
||||||
|
|
||||||
|
test('When a function appears in the topscope of a module, the symbol is documented as an inner member of that module.', function() {
|
||||||
|
assert.equal(typeof fooOut, 'object');
|
||||||
|
assert.equal(fooOut.longname, 'module:my/module~fooOut');
|
||||||
|
|
||||||
|
assert.equal(typeof fooIn, 'object');
|
||||||
|
assert.equal(fooIn.longname, 'module:my/module~fooIn');
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
Loading…
x
Reference in New Issue
Block a user