Commit 5beeace4 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make subproperties inheritable.

parent bd4c3b7c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+24 −0
Original line number Diff line number Diff line
@@ -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)