mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
allow interfaces to augment other interfaces (#897)
This commit is contained in:
parent
930cc2c473
commit
80bce1db42
@ -14,7 +14,7 @@ function mapDependencies(index, propertyName) {
|
|||||||
var dependencies = {};
|
var dependencies = {};
|
||||||
var doc;
|
var doc;
|
||||||
var doclets;
|
var doclets;
|
||||||
var kinds = ['class', 'external', 'mixin'];
|
var kinds = ['class', 'external', 'interface', 'mixin'];
|
||||||
var len = 0;
|
var len = 0;
|
||||||
|
|
||||||
Object.keys(index).forEach(function(indexName) {
|
Object.keys(index).forEach(function(indexName) {
|
||||||
@ -175,7 +175,7 @@ function getInheritedAdditions(doclets, docs, documented) {
|
|||||||
doc = doclets[i];
|
doc = doclets[i];
|
||||||
parents = doc.augments;
|
parents = doc.augments;
|
||||||
|
|
||||||
if (parents && doc.kind === 'class') {
|
if ( parents && (doc.kind === 'class' || doc.kind === 'interface') ) {
|
||||||
// reset the lookup table of added doclet indexes by longname
|
// reset the lookup table of added doclet indexes by longname
|
||||||
additionIndexes = {};
|
additionIndexes = {};
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
var docSet3 = jasmine.getDocSetFromFile('test/fixtures/augmentstag3.js');
|
var docSet3 = jasmine.getDocSetFromFile('test/fixtures/augmentstag3.js');
|
||||||
var docSet4 = jasmine.getDocSetFromFile('test/fixtures/augmentstag4.js');
|
var docSet4 = jasmine.getDocSetFromFile('test/fixtures/augmentstag4.js');
|
||||||
var docSet5 = jasmine.getDocSetFromFile('test/fixtures/augmentstag5.js');
|
var docSet5 = jasmine.getDocSetFromFile('test/fixtures/augmentstag5.js');
|
||||||
|
var docSet6 = jasmine.getDocSetFromFile('test/fixtures/augmentstag6.js');
|
||||||
|
|
||||||
it('When a symbol has an @augments tag, the doclet has a augments property that includes that value.', function() {
|
it('When a symbol has an @augments tag, the doclet has a augments property that includes that value.', function() {
|
||||||
var bar = docSet.getByLongname('Bar')[0];
|
var bar = docSet.getByLongname('Bar')[0];
|
||||||
@ -163,4 +164,12 @@
|
|||||||
expect(classCommonMethod.length).toBe(1);
|
expect(classCommonMethod.length).toBe(1);
|
||||||
expect(classCommonMethod[0].description).toBe(base1CommonMethod.description);
|
expect(classCommonMethod[0].description).toBe(base1CommonMethod.description);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Interfaces can augment other interfaces', function() {
|
||||||
|
var connectionOpen = docSet6.getByLongname('IConnection#open')[0];
|
||||||
|
var closableConnectionOpen = docSet6.getByLongname('IClosableConnection#open')[0];
|
||||||
|
|
||||||
|
expect(closableConnectionOpen).toBeDefined();
|
||||||
|
expect(closableConnectionOpen.description).toBe(connectionOpen.description);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user