Loading lib/jsduck/merger.rb +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ module JsDuck :method elsif code[:type] == :assignment && code[:right] && code[:right][:type] == :function :method elsif doc_map[:return] || doc_map[:param] :method else :property end Loading spec/aggregator_methods_and_events_spec.rb +26 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,32 @@ describe JsDuck::Aggregator do it_should_behave_like "has return" end describe "Doc-comment not followed by function but containing @return" do before do @doc = parse(<<-EOS)[0] /** * Some function * @returns {String} return value */ var foo = Ext.emptyFn; EOS end it_should_behave_like "method documentation" end describe "Doc-comment not followed by function but containing @param" do before do @doc = parse(<<-EOS)[0] /** * Some function * @param {String} x */ var foo = Ext.emptyFn; EOS end it_should_behave_like "method documentation" end describe "method without doc-comment" do before do @docs = parse(<<-EOS) Loading Loading
lib/jsduck/merger.rb +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ module JsDuck :method elsif code[:type] == :assignment && code[:right] && code[:right][:type] == :function :method elsif doc_map[:return] || doc_map[:param] :method else :property end Loading
spec/aggregator_methods_and_events_spec.rb +26 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,32 @@ describe JsDuck::Aggregator do it_should_behave_like "has return" end describe "Doc-comment not followed by function but containing @return" do before do @doc = parse(<<-EOS)[0] /** * Some function * @returns {String} return value */ var foo = Ext.emptyFn; EOS end it_should_behave_like "method documentation" end describe "Doc-comment not followed by function but containing @param" do before do @doc = parse(<<-EOS)[0] /** * Some function * @param {String} x */ var foo = Ext.emptyFn; EOS end it_should_behave_like "method documentation" end describe "method without doc-comment" do before do @docs = parse(<<-EOS) Loading