diff --git a/rhino_modules/jsdoc/src/handlers.js b/rhino_modules/jsdoc/src/handlers.js index 8443a73f..0982b6ec 100644 --- a/rhino_modules/jsdoc/src/handlers.js +++ b/rhino_modules/jsdoc/src/handlers.js @@ -94,6 +94,12 @@ } 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(); diff --git a/rhino_modules/jsdoc/tag/dictionary/definitions.js b/rhino_modules/jsdoc/tag/dictionary/definitions.js index 17170039..06ceb488 100644 --- a/rhino_modules/jsdoc/tag/dictionary/definitions.js +++ b/rhino_modules/jsdoc/tag/dictionary/definitions.js @@ -416,6 +416,12 @@ } }); + dictionary.defineTag('static', { + onTagged: function(doclet, tag) { + setDocletScopeToTitle(doclet, tag); + } + }); + dictionary.defineTag('summary', { mustHaveValue: true, onTagged: function(doclet, tag) { diff --git a/test/cases/moduleinner.js b/test/cases/moduleinner.js new file mode 100644 index 00000000..7f2d0a3f --- /dev/null +++ b/test/cases/moduleinner.js @@ -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() { +}; \ No newline at end of file diff --git a/test/runner.js b/test/runner.js index ac6fe130..43b24f93 100644 --- a/test/runner.js +++ b/test/runner.js @@ -125,6 +125,7 @@ testFile('test/t/cases/ignoretag.js'); testFile('test/t/cases/lends.js'); testFile('test/t/cases/lends2.js'); testFile('test/t/cases/lendsglobal.js'); +testFile('test/t/cases/moduleinner.js'); testFile('test/t/cases/memberoftag.js'); testFile('test/t/cases/memberoftag2.js'); testFile('test/t/cases/moduletag.js'); diff --git a/test/t/cases/moduleinner.js b/test/t/cases/moduleinner.js new file mode 100644 index 00000000..fc48ba9a --- /dev/null +++ b/test/t/cases/moduleinner.js @@ -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'); + }); + +})(); \ No newline at end of file