test for variable-scoping issue in JSDoc 3.2.1 (#513)

This commit is contained in:
Jeff Williams 2013-11-04 07:51:23 -08:00
parent a3d3384293
commit 01882a231b
2 changed files with 24 additions and 1 deletions

13
test/fixtures/exportstag5.js vendored Normal file
View File

@ -0,0 +1,13 @@
define(function() {
'use strict';
var bar = function() {};
/** @exports Foo */
var Foo = Object.create(
/** @lends module:Foo.prototype */
{
/** This should be in the Foo module doc. */
bar : function() {}
}
);
return Foo;
});

View File

@ -1,3 +1,4 @@
/*global describe: true, expect: true, it: true, jasmine: true */
describe("@exports tag", function() {
describe("object literals", function() {
@ -86,4 +87,13 @@ describe("@exports tag", function() {
//expect(inhead.memberof, 'module:html/utils');
});
});
});
describe('variable shadowing', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/exportstag5.js');
var method = docSet.getByLongname('module:Foo#bar')[0];
it('A variable defined in an inner scope should correctly shadow a variable in an outer scope.', function() {
expect(method.description).toBe('This should be in the Foo module doc.');
});
});
});