Commit 67b6894e authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Don't create accessors for private config options.

parent 90121b31
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ module JsDuck
    # not added.
    def create(cls)
      # Grab all configs tagged as @accessor
      accessors = cls[:members][:cfg].find_all {|cfg| cfg[:accessor] }
      accessors = cls[:members][:cfg].find_all {|cfg| cfg[:accessor] && !cfg[:private] }

      # Build lookup tables of method and event names
      methods = build_lookup_table(cls[:members][:method])
+17 −0
Original line number Diff line number Diff line
@@ -119,6 +119,23 @@ describe JsDuck::Aggregator do

  end

  describe "@accessor tag on private cfg" do
    before do
      @docs = parse(<<-EOF)
        /** @class MyClass */
          /**
           * @cfg {String} foo
           * @private
           * @accessor
           */
      EOF
    end

    it "doesn't create any accessors" do
      @docs[0][:members][:method].length.should == 0
    end
  end

  describe "@cfg foo with @evented @accessor" do
    before do
      @docs = parse(<<-EOF)