Commit 071cd258 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Refactor @static into attributes hash.

parent c701d753
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ module JsDuck
    end

    def add_to_class(cls, member)
      cls[member[:static] ? :statics : :members][member[:tagname]] << member
      cls[member[:attributes][:static] ? :statics : :members][member[:tagname]] << member
    end

    def add_orphan(node)
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ module JsDuck

    def compact_member(m)
      m_copy = {}
      [:name, :tagname, :owner, :static, :deprecated, :attributes, :id].each do |key|
      [:name, :tagname, :owner, :deprecated, :attributes, :id].each do |key|
        m_copy[key] = m[key]
      end
      m_copy
+2 −2
Original line number Diff line number Diff line
@@ -138,8 +138,6 @@ module JsDuck
          at_deprecated
        elsif look(/@var\b/)
          at_var
        elsif look(/@static\b/)
          boolean_at_tag(/@static/, :static)
        elsif look(/@inheritable\b/)
          boolean_at_tag(/@inheritable/, :inheritable)
        elsif look(/@(private|ignore|hide)\b/)
@@ -148,6 +146,8 @@ module JsDuck
          boolean_at_tag(/@accessor/, :accessor)
        elsif look(/@evented\b/)
          boolean_at_tag(/@evented/, :evented)
        elsif look(/@static\b/)
          attribute_tag(/@static/, :static)
        elsif look(/@protected\b/)
          attribute_tag(/@protected/, :protected)
        elsif look(/@template\b/)
+1 −2
Original line number Diff line number Diff line
@@ -220,7 +220,6 @@ module JsDuck
    def add_shared(hash, doc_map)
      hash.merge!({
        :private => !!doc_map[:private],
        :static => !!doc_map[:static],
        :inheritable => !!doc_map[:inheritable],
        :deprecated => detect_deprecated(doc_map),
        :inheritdoc => doc_map[:inheritdoc] ? doc_map[:inheritdoc].first : nil,
@@ -234,7 +233,7 @@ module JsDuck
    def create_member_id(m)
      # Sanitize $ in member names with something safer
      name = m[:name].gsub(/\$/, 'S-')
      "#{m[:static] ? 'static-' : ''}#{m[:tagname]}-#{name}"
      "#{m[:attributes][:static] ? 'static-' : ''}#{m[:tagname]}-#{name}"
    end

    def detect_name(tagname, doc_map, code, name_type = :last_name)
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ module JsDuck
      if m[:attributes][:protected]
        after += "<strong class='protected signature'>protected</strong>"
      end
      if m[:static]
      if m[:attributes][:static]
        after += "<strong class='static signature'>static</strong>"
      end
      if m[:deprecated]
Loading