Commit 94e322ed authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Add special flag to auto-inserted Ext4 event param.

By using just the name "eOpts" we can't really be sure if the
parameter was auto-inserted or manually added by user.
parent 5a0ce3d2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ module JsDuck
        :tagname => :params,
        :name => "eOpts",
        :type => "Object",
        :doc => "The options object passed to {@link Ext.util.Observable#addListener}."
        :doc => "The options object passed to {@link Ext.util.Observable#addListener}.",
        :ext4_auto_param => true,
      }

    end
+2 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ module JsDuck
      end

      def inherit_params?(m, parent)
        # ignore the eOpts auto-inserted param of Ext4-style events
        params = (m[:params] || []).reject {|p| p[:name] == "eOpts" }
        # ignore the auto-inserted param of Ext4-style events
        params = (m[:params] || []).reject {|p| p[:ext4_auto_param] }

        if params.length > 0 && !auto?(m, :params)
          # member itself has params and these are not auto-detected
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ describe JsDuck::Aggregator do
    it "with standard description" do
      event[:params][2][:doc].should =~ /The options object passed to.*addListener/
    end

    it "with special :ext4event flag" do
      event[:params][2][:ext4_auto_param].should == true
    end
  end

  describe "When some class defined with Ext.define" do