Commit 6031c423 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Parsing Ext.define into type :ext_define.

Previously it was :assignment, which was a hack.
parent d33184ad
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ module JsDuck
        :method
      elsif doc_map[:property] || doc_map[:type]
        :property
      elsif code[:type] == :ext_extend
      elsif code[:type] == :ext_define
        :class
      elsif code[:type] == :assignment && class_name?(*code[:left])
        :class
@@ -176,6 +176,8 @@ module JsDuck
        code[:name]
      elsif code[:type] == :assignment
        name_type == :full_name ? code[:left].join(".") : code[:left].last
      elsif code[:type] == :ext_define
        name_type == :full_name ? code[:name] : code[:name].split(/\./).last
      else
        ""
      end
+1 −2
Original line number Diff line number Diff line
@@ -182,9 +182,8 @@ module JsDuck
    def ext_define
      match("Ext", ".", "define", "(")
      return {
        :type => :function,
        :type => :ext_define,
        :name => look(:string) ? match(:string) : nil,
        :params => []
      }
    end