Commit 13d94165 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make auto-detect of @accessor work with doc-comment too.

parent 025762f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ module JsDuck

      ast["properties"].each do |p|
        cfg = make_property(key_value(p["key"]), p["value"], :cfg)
        cfg[:accessor] = true
        # When config has a comment, update the related docset,
        # otherwise add it as new config to current class.
        docset = find_docset(p)
@@ -249,7 +250,6 @@ module JsDuck
          docset[:code] = cfg
        else
          cfg[:inheritdoc] = {}
          cfg[:accessor] = true
          cfg[:autodetected] = true
          configs << cfg
        end
+4 −0
Original line number Diff line number Diff line
@@ -126,6 +126,10 @@ describe JsDuck::Aggregator do
    it "detects the config as public" do
      docs[0][:members][:cfg][0][:private].should_not == true
    end

    it "detects the config accessor" do
      docs[0][:members][:cfg][0][:accessor].should == true
    end
  end

end