Commit 04add0f8 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Use of Ext.define now implies extending Ext.Base.

When using Ext.define and not having {extend: "SomeClass"} or
@extend SomeClass, then automatically assuming that we're extending
Ext.Base.
parent de8ace41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -257,7 +257,8 @@ module JsDuck
      elsif code[:type] == :assignment && code[:right] && code[:right][:type] == :ext_extend
        code[:right][:extend].join(".")
      elsif code[:type] == :ext_define
        code[:extend]
        # Classes defined with Ext.define will automatically inherit from Ext.Base
        code[:extend] || "Ext.Base"
      end
    end

+13 −0
Original line number Diff line number Diff line
@@ -238,6 +238,19 @@ describe JsDuck::Aggregator do
    it_should_behave_like "Ext.define"
  end

  describe "Ext.define() without extend" do
    before do
      @doc = parse(<<-EOS)[0]
        /** */
        Ext.define('MyClass', {
        });
      EOS
    end
    it "automatically extends from Ext.Base" do
      @doc[:extends].should == "Ext.Base"
    end
  end

  describe "class with cfgs" do
    before do
      @doc = parse(<<-EOS)[0]