Commit e6817679 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Move detection of extends from DocAst to Tag::Extends.

parent a883bce2
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ module JsDuck
        :tagname => :class,
        :name => detect_name(:class, doc_map),
        :doc => detect_doc(docs),
        :extends => detect_extends(doc_map),
        :mixins => detect_list(:mixins, doc_map),
        :alternateClassNames => detect_list(:alternateClassNames, doc_map),
        :aliases => detect_aliases(doc_map),
@@ -155,10 +154,6 @@ module JsDuck
      extract(doc_map, tagname, :type) || extract(doc_map, :type, :type)
    end

    def detect_extends(doc_map)
      extract(doc_map, :extends, :extends)
    end

    def detect_default(tagname, doc_map)
      extract(doc_map, tagname, :default)
    end
+5 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ module JsDuck::Tag
  class Extends < Tag
    def initialize
      @pattern = ["extend", "extends"]
      @key = :extends
      @ext_define_pattern = "extend"
      @ext_define_default = {:extends => "Ext.Base"}
    end
@@ -15,6 +16,10 @@ module JsDuck::Tag
      p.maybe_ident_chain(:extends)
    end

    def process_doc(tags)
      tags[0][:extends]
    end

    def parse_ext_define(cls, ast)
      cls[:extends] = JsDuck::AstUtils.make_string(ast)
    end