From 5beeace4e88df6c7d515d0de5249a3598d77ebcb Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Thu, 14 Nov 2013 20:03:03 +0200 Subject: [PATCH] Make subproperties inheritable. --- lib/jsduck/process/inherit_members.rb | 1 + spec/aggregator_inheritdoc_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib/jsduck/process/inherit_members.rb b/lib/jsduck/process/inherit_members.rb index 00a83253..4110732a 100644 --- a/lib/jsduck/process/inherit_members.rb +++ b/lib/jsduck/process/inherit_members.rb @@ -19,6 +19,7 @@ module JsDuck # - :params # - :return # - :throws + # - :properties # # In case of auto-detected members that inherit from a public # member in parent class, we inherit all fields that aren't diff --git a/spec/aggregator_inheritdoc_spec.rb b/spec/aggregator_inheritdoc_spec.rb index a52bab2c..36724122 100644 --- a/spec/aggregator_inheritdoc_spec.rb +++ b/spec/aggregator_inheritdoc_spec.rb @@ -164,6 +164,30 @@ describe JsDuck::Aggregator do end end + describe "@inheritdoc in @cfg with subproperties" do + before do + @docs = parse(<<-EOF) + /** @class Foo */ + /** + * @cfg {Object} foo Original comment. + * @cfg {String} foo.name Some name + * @cfg {Number} foo.value Some value + */ + + /** @class Inh1 */ + /** + * @cfg foo + * @inheritdoc Foo#foo + */ + EOF + @inh1 = @docs["Inh1"][:members][0] + end + + it "inherits subproperties" do + @inh1[:properties].length.should == 2 + end + end + describe "@inheritdoc with type info" do before do @docs = parse(<<-EOF) -- GitLab