Commit 5407cc87 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Mark all auto-merged fields as auto-detected.

parent 47261b3b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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"