Loading lib/jsduck/doc_parser.rb +13 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ module JsDuck @tags << @current_tag = {:tagname => tag, :doc => ""} end def remove_last_tag @tags.pop @current_tag = @tags.last end def parse_loop add_tag(:default) while !@input.eos? do Loading Loading @@ -302,6 +307,14 @@ module JsDuck add_tag(:override) maybe_ident_chain(:class) skip_white # When @override not followed by class name, ignore the tag. # That's because the current ext codebase has some methods # tagged with @override to denote they override something. # But that's not what @override is meant for in JSDuck. unless @current_tag[:class] remove_last_tag end end # matches @type {type} or @type type Loading spec/aggregator_overrides_spec.rb +18 −0 Original line number Diff line number Diff line Loading @@ -285,4 +285,22 @@ describe JsDuck::Aggregator do methods["foobar"][:doc].should == "**Overridden in blah.js.**" end end describe "@override without classname" do let(:classes) do parse(<<-EOF) /** */ Ext.define("Foo", { /** @override */ foo: function() { } }); EOF end let(:methods) { create_members_map(classes["Foo"]) } it "gets ignored" do methods["foo"].should_not == nil end end end Loading
lib/jsduck/doc_parser.rb +13 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ module JsDuck @tags << @current_tag = {:tagname => tag, :doc => ""} end def remove_last_tag @tags.pop @current_tag = @tags.last end def parse_loop add_tag(:default) while !@input.eos? do Loading Loading @@ -302,6 +307,14 @@ module JsDuck add_tag(:override) maybe_ident_chain(:class) skip_white # When @override not followed by class name, ignore the tag. # That's because the current ext codebase has some methods # tagged with @override to denote they override something. # But that's not what @override is meant for in JSDuck. unless @current_tag[:class] remove_last_tag end end # matches @type {type} or @type type Loading
spec/aggregator_overrides_spec.rb +18 −0 Original line number Diff line number Diff line Loading @@ -285,4 +285,22 @@ describe JsDuck::Aggregator do methods["foobar"][:doc].should == "**Overridden in blah.js.**" end end describe "@override without classname" do let(:classes) do parse(<<-EOF) /** */ Ext.define("Foo", { /** @override */ foo: function() { } }); EOF end let(:methods) { create_members_map(classes["Foo"]) } it "gets ignored" do methods["foo"].should_not == nil end end end