From 92ba112ece19627f874e99aeaf6d73709160c8cb Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Fri, 25 Jan 2013 22:49:03 -0800 Subject: [PATCH] de-IIFE; minor refactoring --- lib/jsdoc/augment.js | 255 +++++++++++++++++++++---------------------- 1 file changed, 125 insertions(+), 130 deletions(-) diff --git a/lib/jsdoc/augment.js b/lib/jsdoc/augment.js index 2c203785..93149bc4 100644 --- a/lib/jsdoc/augment.js +++ b/lib/jsdoc/augment.js @@ -1,139 +1,134 @@ -(function() { - var doop = require("jsdoc/util/doop").doop, - hasOwnProp = Object.prototype.hasOwnProperty; - - exports.addInherited = function(docs) { - var dependencies = mapDependencies(docs.index); - var sorted = sort(dependencies); - var longnames = []; +var hasOwnProp = Object.prototype.hasOwnProperty; - // only build the list of longnames if we'll actually need it - if (sorted.length) { - longnames = docs.map(function(doc) { - if (doc.longname) { - return doc.longname; +function mapDependencies(index) { + var doclets, doc, len, dependencies = {}; + for (var name in index) { + if ( hasOwnProp.call(index, name) ) { + doclets = index[name]; + for (var i=0, ii=doclets.length; i