Commit 8a2250d8 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Append options object to params of each event.

In Ext4 each event handler will receive an additional options argument
that was given in the addListener method.  To make this clear, we
automatically append this extra parameter to each event.
parent 3ee957e9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -160,6 +160,19 @@ module JsDuck
      })
    end

    # Appends Ext4 options parameter to each event parameter list.
    def append_ext4_event_options
      options = {
        :tagname => :param,
        :name => "options",
        :type => "Object",
        :doc => "The options object passed to {@link Ext.util.Observable#addListener}."
      }
      @classes.each_value do |cls|
        cls[:event].each {|e| e[:params] << options }
      end
    end

    def result
      @documentation + @orphans
    end
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ module JsDuck
      agr.classify_orphans
      agr.populate_aliases
      agr.create_global_class unless @ignore_global
      agr.append_ext4_event_options
      agr.result
    end