From bc2044d48bb2dee5a2b44bec8384f9a53d6d1182 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 28 Aug 2014 13:28:01 +0200 Subject: [PATCH] Walk up the inheritance chain to an exportable constructor --- config/jsdoc/info/publish.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/jsdoc/info/publish.js b/config/jsdoc/info/publish.js index 23747fe591..1c390bb43f 100644 --- a/config/jsdoc/info/publish.js +++ b/config/jsdoc/info/publish.js @@ -14,6 +14,9 @@ var path = require('path'); */ exports.publish = function(data, opts) { + var exportables = {}; + var classes = {}; + function getTypes(data) { var types = []; data.forEach(function(name) { @@ -30,6 +33,9 @@ exports.publish = function(data, opts) { {api: {isString: true}}, {'interface': {is: true}}, function() { + if (this.kind == 'class') { + classes[this.longname] = this; + } return this.meta && (/[\\\/]externs$/).test(this.meta.path); } ], @@ -133,6 +139,16 @@ exports.publish = function(data, opts) { } var target = isExterns ? externs : (doc.interface ? interfaces : symbols); target.push(symbol); + + if (symbol.stability && symbol.kind == 'class') { + exportables[symbol.name] = true; + } + if (symbol.extends) { + while (!(symbol.extends in exportables) && + symbol.extends in classes && classes[symbol.extends].augments) { + symbol.extends = classes[symbol.extends].augments[0]; + } + } } });