Loading lib/jsduck/merger.rb +7 −3 Original line number Diff line number Diff line Loading @@ -55,11 +55,15 @@ module JsDuck h[key] = value unless h.has_key?(key) || Merger::explicit?(key) end # Add all items in code not already in result. # But only if the explicit and auto-detected names don't conflict. # Add all items in code not already in result and mark them as # auto-detected. But only if the explicit and auto-detected # names don't conflict. if DocsCodeComparer.matches?(docs, code) code.each_pair do |key, value| h[key] = value unless h.has_key?(key) || Merger::explicit?(key) unless h.has_key?(key) || Merger::explicit?(key) h[key] = value DocsCodeComparer.mark_autodetected(h, key) end end end end Loading spec/aggregator_chainable_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,10 @@ describe JsDuck::Aggregator do cls[:members][0][:chainable].should == true end it "marks :chainable field as autodetected" do cls[:members][0][:autodetected][:chainable].should == true end it "adds @return {MyClass} this" do cls[:members][0][:return][:type].should == "MyClass" cls[:members][0][:return][:doc].should == "this" Loading Loading
lib/jsduck/merger.rb +7 −3 Original line number Diff line number Diff line Loading @@ -55,11 +55,15 @@ module JsDuck h[key] = value unless h.has_key?(key) || Merger::explicit?(key) end # Add all items in code not already in result. # But only if the explicit and auto-detected names don't conflict. # Add all items in code not already in result and mark them as # auto-detected. But only if the explicit and auto-detected # names don't conflict. if DocsCodeComparer.matches?(docs, code) code.each_pair do |key, value| h[key] = value unless h.has_key?(key) || Merger::explicit?(key) unless h.has_key?(key) || Merger::explicit?(key) h[key] = value DocsCodeComparer.mark_autodetected(h, key) end end end end Loading
spec/aggregator_chainable_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,10 @@ describe JsDuck::Aggregator do cls[:members][0][:chainable].should == true end it "marks :chainable field as autodetected" do cls[:members][0][:autodetected][:chainable].should == true end it "adds @return {MyClass} this" do cls[:members][0][:return][:type].should == "MyClass" cls[:members][0][:return][:doc].should == "this" Loading