Loading lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ module JsDuck while !@input.eos? do if look(/@class\b/) at_class elsif look(/@extends\b/) elsif look(/@extends?\b/) at_extends elsif look(/@singleton\b/) boolean_at_tag(/@singleton/, :singleton) Loading Loading @@ -126,7 +126,7 @@ module JsDuck # matches @extends name ... def at_extends match(/@extends/) match(/@extends?/) add_tag(:extends) maybe_ident_chain(:extends) skip_white Loading spec/aggregator_classes_spec.rb +18 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ describe JsDuck::Aggregator do it_should_behave_like "class" it "detects extends" do @doc[:extends] == "Your.Class" @doc[:extends].should == "Your.Class" end it "takes documentation from doc-comment" do @doc[:doc].should == "Some documentation." Loading @@ -46,6 +46,23 @@ describe JsDuck::Aggregator do end end describe "class with @extend" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @extend Your.Class * Some documentation. */ EOS end it_should_behave_like "class" it "treated as alias for @extends" do @doc[:extends].should == "Your.Class" end end describe "function after doc-comment" do before do @doc = parse("/** */ function MyClass() {}")[0] Loading Loading
lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ module JsDuck while !@input.eos? do if look(/@class\b/) at_class elsif look(/@extends\b/) elsif look(/@extends?\b/) at_extends elsif look(/@singleton\b/) boolean_at_tag(/@singleton/, :singleton) Loading Loading @@ -126,7 +126,7 @@ module JsDuck # matches @extends name ... def at_extends match(/@extends/) match(/@extends?/) add_tag(:extends) maybe_ident_chain(:extends) skip_white Loading
spec/aggregator_classes_spec.rb +18 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ describe JsDuck::Aggregator do it_should_behave_like "class" it "detects extends" do @doc[:extends] == "Your.Class" @doc[:extends].should == "Your.Class" end it "takes documentation from doc-comment" do @doc[:doc].should == "Some documentation." Loading @@ -46,6 +46,23 @@ describe JsDuck::Aggregator do end end describe "class with @extend" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @extend Your.Class * Some documentation. */ EOS end it_should_behave_like "class" it "treated as alias for @extends" do @doc[:extends].should == "Your.Class" end end describe "function after doc-comment" do before do @doc = parse("/** */ function MyClass() {}")[0] Loading