Commit bbb25791 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Allow configs with subproperties inside @class doc-comment.

parent fc3de21f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ module JsDuck

        if tagname == :cfg || tagname == :constructor
          group_name = tagname
          if tagname == :cfg
          if tagname == :cfg && tag[:name] !~ /\./
            groups[:cfg] << []
          end
        end
+20 −0
Original line number Diff line number Diff line
@@ -308,6 +308,26 @@ describe JsDuck::Aggregator do
    end
  end

  describe "class with cfgs with subproperties" do
    before do
      @doc = parse(<<-EOS)[0]
        /**
         * @class MyClass
         * Comment here.
         * @cfg {Object} foo
         * @cfg {String} foo.one
         * @cfg {String} foo.two
         * @cfg {Function} bar
         * @cfg {Boolean} bar.arg
         */
      EOS
    end

    it "detects the configs taking account the subproperties" do
      @doc[:members].length.should == 2
    end
  end

  describe "implicit class with more than one cfg" do
    before do
      @doc = parse(<<-EOS)[0]