Loading lib/jsduck/aliases.rb +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ module JsDuck # Copy over doc/params/return from original methods to aliases. def resolve(al) al_def = al[:alias] orig = @relations[al_def[:cls]].get_member(al_def[:member], al_def[:type]) orig = @relations[al_def[:cls]].get_member(al_def[:member], al_def[:type] || al[:tagname]) al[:doc] = al[:doc] + "\n\n" + orig[:doc] al[:params] = orig[:params] if orig[:params] al[:return] = orig[:return] if orig[:return] Loading spec/aggregator_alias_spec.rb +31 −0 Original line number Diff line number Diff line Loading @@ -182,5 +182,36 @@ describe JsDuck::Aggregator do it_behaves_like "@alias" end describe "@alias without type info uses the type of itself" do before do @docs = parse(<<-EOF) /** @class Foo */ /** * @cfg bar * Original comment. */ /** * @method bar * Method comment. */ /** * @property bar * Prop comment. */ /** @class Core */ /** * @cfg foobar * Alias comment. * @alias Foo#bar */ EOF @orig = @docs["Foo"][:members][:cfg][0] @alias = @docs["Core"][:members][:cfg][0] end it_behaves_like "@alias" end end Loading
lib/jsduck/aliases.rb +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ module JsDuck # Copy over doc/params/return from original methods to aliases. def resolve(al) al_def = al[:alias] orig = @relations[al_def[:cls]].get_member(al_def[:member], al_def[:type]) orig = @relations[al_def[:cls]].get_member(al_def[:member], al_def[:type] || al[:tagname]) al[:doc] = al[:doc] + "\n\n" + orig[:doc] al[:params] = orig[:params] if orig[:params] al[:return] = orig[:return] if orig[:return] Loading
spec/aggregator_alias_spec.rb +31 −0 Original line number Diff line number Diff line Loading @@ -182,5 +182,36 @@ describe JsDuck::Aggregator do it_behaves_like "@alias" end describe "@alias without type info uses the type of itself" do before do @docs = parse(<<-EOF) /** @class Foo */ /** * @cfg bar * Original comment. */ /** * @method bar * Method comment. */ /** * @property bar * Prop comment. */ /** @class Core */ /** * @cfg foobar * Alias comment. * @alias Foo#bar */ EOF @orig = @docs["Foo"][:members][:cfg][0] @alias = @docs["Core"][:members][:cfg][0] end it_behaves_like "@alias" end end