mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
test for variable-scoping issue in JSDoc 3.2.1 (#513)
This commit is contained in:
parent
a3d3384293
commit
01882a231b
13
test/fixtures/exportstag5.js
vendored
Normal file
13
test/fixtures/exportstag5.js
vendored
Normal 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;
|
||||
});
|
||||
@ -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.');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user