Commit 873d74c1 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Allow dot in xtype name.

Basically when seeing "widget.foo.bar" treat it as widget: foo.bar
not as widget.foo: bar.
parent b229d6cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ module JsDuck
    # it instead of creating a new hash.
    def build_aliases_hash(aliases, hash={})
      aliases.each do |a|
        if a =~ /^(.+)\.([^.]+)$/
        if a =~ /^([^.]+)\.(.+)$/
          if hash[$1]
            hash[$1] << $2
          else
+14 −0
Original line number Diff line number Diff line
@@ -157,6 +157,20 @@ describe JsDuck::Aggregator do
    it_should_behave_like "multiple aliases"
  end

  describe "Alias with more than one dot (.) in it" do
    before do
      @doc = parse(<<-EOS)[0]
        /**
         * @class MyClass
         * @alias widget.foo.bar
         */
      EOS
    end
    it "will use the first part as namespace" do
      @doc[:aliases].should == {"widget" => ["foo.bar"]}
    end
  end

  describe "Ext.define() with simple alias" do
    before do
      @doc = parse(<<-EOS)[0]