remove scope property from module doclets (#742)

This commit is contained in:
Jeff Williams 2014-08-19 12:51:30 -07:00
parent 55f40e1085
commit 81d74b9b92
2 changed files with 8 additions and 3 deletions

View File

@ -97,7 +97,8 @@ function setModuleScopeMemberOf(doclet) {
}
function setDefaultScope(doclet) {
if (!doclet.scope) {
// module doclets don't get a default scope
if (!doclet.scope && doclet.kind !== 'module') {
doclet.setScope('global');
}
}

View File

@ -26,12 +26,16 @@ describe('@module tag', function() {
var blend = docSet.getByLongname('module:color/mixer.blend')[0];
var darken = docSet.getByLongname('module:color/mixer.darken')[0];
it('When a @module tag defines a module module, a symbol of kind "module" is documented', function() {
it('When a @module tag defines a module, a symbol of kind "module" is documented', function() {
expect(typeof mixer).toBe('object');
expect(mixer.kind).toBe('module');
});
it('When an object literal is lent to a module with a @lends tag, A member of that object literal is documented as a member of the module', function() {
it('When a @module tag defines a module, the module doclet does not have a "scope" property', function() {
expect(mixer.scope).not.toBeDefined();
});
it('When an object literal is lent to a module with a @lends tag, a member of that object literal is documented as a member of the module', function() {
expect(typeof blend).toBe('object');
expect(blend.kind).toBe('function');
});