Loading lib/jsduck/merger.rb +2 −2 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ module JsDuck :owner => detect_owner(doc_map), :doc => detect_doc(docs), :params => detect_params(docs, code), :return => detect_return(doc_map, name == "constructor" ? "Object" : "void"), :return => detect_return(doc_map, name == "constructor" ? "Object" : "undefined"), }, doc_map) end Loading Loading @@ -337,7 +337,7 @@ module JsDuck docs.find_all {|tag| tag[:tagname] == :param} end def detect_return(doc_map, default_type="void") def detect_return(doc_map, default_type="undefined") ret = doc_map[:return] ? doc_map[:return].first : {} return { :type => ret[:type] || default_type, Loading spec/aggregator_methods_and_events_spec.rb +2 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,8 @@ describe JsDuck::Aggregator do end shared_examples_for "no return" do it "default return type is void" do @doc[:return][:type].should == "void" it "default return type is undefined" do @doc[:return][:type].should == "undefined" end end Loading template/app/view/cls/Overview.js +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ Ext.define('Docs.view.cls.Overview', { else { var ps = Ext.Array.map(member.params, this.renderShortParam, this).join(", "); cfg.params = '( <span class="pre">' + ps + "</span> )"; if (member.tagname === "method") { if (member.tagname === "method" && member["return"].type !== "undefined") { cfg.params += " : " + member["return"].type; } } Loading Loading
lib/jsduck/merger.rb +2 −2 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ module JsDuck :owner => detect_owner(doc_map), :doc => detect_doc(docs), :params => detect_params(docs, code), :return => detect_return(doc_map, name == "constructor" ? "Object" : "void"), :return => detect_return(doc_map, name == "constructor" ? "Object" : "undefined"), }, doc_map) end Loading Loading @@ -337,7 +337,7 @@ module JsDuck docs.find_all {|tag| tag[:tagname] == :param} end def detect_return(doc_map, default_type="void") def detect_return(doc_map, default_type="undefined") ret = doc_map[:return] ? doc_map[:return].first : {} return { :type => ret[:type] || default_type, Loading
spec/aggregator_methods_and_events_spec.rb +2 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,8 @@ describe JsDuck::Aggregator do end shared_examples_for "no return" do it "default return type is void" do @doc[:return][:type].should == "void" it "default return type is undefined" do @doc[:return][:type].should == "undefined" end end Loading
template/app/view/cls/Overview.js +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ Ext.define('Docs.view.cls.Overview', { else { var ps = Ext.Array.map(member.params, this.renderShortParam, this).join(", "); cfg.params = '( <span class="pre">' + ps + "</span> )"; if (member.tagname === "method") { if (member.tagname === "method" && member["return"].type !== "undefined") { cfg.params += " : " + member["return"].type; } } Loading