Loading lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ module JsDuck match(/@xtype/) add_tag(:alias) skip_horiz_white @current_tag[:name] = "widget." + ident_chain @current_tag[:name] = "widget." + (ident_chain || "") skip_white end Loading @@ -330,7 +330,7 @@ module JsDuck match(/@ftype/) add_tag(:alias) skip_horiz_white @current_tag[:name] = "feature." + ident_chain @current_tag[:name] = "feature." + (ident_chain || "") skip_white end Loading spec/aggregator_aliases_spec.rb +42 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,34 @@ describe JsDuck::Aggregator do it_should_behave_like "multiple aliases" end describe "class with @alias tag without name" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @alias */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "class with @alias tag without namespace" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @alias foo */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "class with @xtype" do before do @doc = parse(<<-EOS)[0] Loading @@ -58,6 +86,20 @@ describe JsDuck::Aggregator do it_should_behave_like "single alias" end describe "class with @xtype tag without name" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @xtype */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "@xtype after @constructor" do before do @doc = parse(<<-EOS)[0] Loading Loading
lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ module JsDuck match(/@xtype/) add_tag(:alias) skip_horiz_white @current_tag[:name] = "widget." + ident_chain @current_tag[:name] = "widget." + (ident_chain || "") skip_white end Loading @@ -330,7 +330,7 @@ module JsDuck match(/@ftype/) add_tag(:alias) skip_horiz_white @current_tag[:name] = "feature." + ident_chain @current_tag[:name] = "feature." + (ident_chain || "") skip_white end Loading
spec/aggregator_aliases_spec.rb +42 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,34 @@ describe JsDuck::Aggregator do it_should_behave_like "multiple aliases" end describe "class with @alias tag without name" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @alias */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "class with @alias tag without namespace" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @alias foo */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "class with @xtype" do before do @doc = parse(<<-EOS)[0] Loading @@ -58,6 +86,20 @@ describe JsDuck::Aggregator do it_should_behave_like "single alias" end describe "class with @xtype tag without name" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @xtype */ EOS end it "ignores the alias" do @doc[:aliases].should == {} end end describe "@xtype after @constructor" do before do @doc = parse(<<-EOS)[0] Loading