mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
consumes ASTs that follow the Mozilla Parser API spec: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API passes all tests on OS X; performance is comparable to previous version. also includes some miscellaneous cleanup. remaining issues: - only Rhino AST builder is supported - node visitors (old and new) may not be hooked up yet - circular-reference issues in doclets - docs are (mostly) missing - various other TODO comments
41 lines
1.8 KiB
JavaScript
41 lines
1.8 KiB
JavaScript
/*global describe: true, expect: true, it: true, jasmine: true */
|
|
describe("inner scope", function() {
|
|
describe("Outer~inner.member cases", function() {
|
|
var docSet = jasmine.getDocSetFromFile('test/fixtures/innerscope.js');
|
|
var to = docSet.getByLongname('Message~headers.to');
|
|
var from = docSet.getByLongname('Message~headers.from');
|
|
var response = docSet.getByLongname('Message~response.code');
|
|
|
|
it('should occur when a member of a var member is documented.', function() {
|
|
expect(to.length).toEqual(1);
|
|
});
|
|
|
|
it('should occur when a second member of a var member is documented.', function() {
|
|
expect(response.length).toEqual(1);
|
|
});
|
|
|
|
it('should occur when a deeply nested member of a var member is documented.', function() {
|
|
expect(from.length).toEqual(1);
|
|
});
|
|
});
|
|
|
|
describe("other cases", function() {
|
|
var docSet = jasmine.getDocSetFromFile('test/fixtures/innerscope2.js');
|
|
var to = docSet.getByLongname('Message~headers.to');
|
|
var from = docSet.getByLongname('<anonymous>~headers.from');
|
|
var cache = docSet.getByLongname('<anonymous>~headers.cache');
|
|
|
|
it('When a var is declared in a function, It is like Inner~member', function() {
|
|
expect(cache.length).toEqual(1);
|
|
});
|
|
|
|
it('When a var is masked by an inner var and a member of the inner is documented, it is like Inner~inner.member', function() {
|
|
expect(from.length).toEqual(1);
|
|
});
|
|
|
|
it('When a documented member is assigned to a var that masks an outer var.', function() {
|
|
expect(from[0].name).toEqual('from');
|
|
expect(from[0].memberof).toEqual('<anonymous>~headers');
|
|
});
|
|
});
|
|
}); |