From 7e23a68c5907a92fc1ef54b763a1cd0030e9973b Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Mon, 29 Dec 2014 15:48:05 -0800 Subject: [PATCH] multiple fixes for overridden symbols (#855) - Don't add an "overrides" property to members that are merely inherited. - In the template, don't show both "overrides" and "inherited from" for the same member. --- lib/jsdoc/augment.js | 7 ++++++- templates/default/tmpl/details.tmpl | 2 +- test/fixtures/augmentstag.js | 5 +++++ test/specs/tags/augmentstag.js | 10 ++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/jsdoc/augment.js b/lib/jsdoc/augment.js index f37be4ca..beafecfd 100644 --- a/lib/jsdoc/augment.js +++ b/lib/jsdoc/augment.js @@ -201,7 +201,12 @@ function getInheritedAdditions(doclets, docs, documented) { // Indicate what the descendant is overriding. (We only care about the closest // ancestor. For classes A > B > C, if B#a overrides A#a, and C#a inherits B#a, // we don't want the doclet for C#a to say that it overrides A#a.) - addDocletProperty([member], 'overrides', members[k].longname); + if (docs.index.longname[member.longname]) { + member.overrides = members[k].longname; + } + else { + delete member.overrides; + } // Add the ancestor's docs unless the descendant overrides the ancestor AND // documents the override. diff --git a/templates/default/tmpl/details.tmpl b/templates/default/tmpl/details.tmpl index 8de29737..d1ff696c 100644 --- a/templates/default/tmpl/details.tmpl +++ b/templates/default/tmpl/details.tmpl @@ -32,7 +32,7 @@ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvalu
- +
Inherited From: