Loading lib/jsduck/ast.rb +7 −4 Original line number Diff line number Diff line Loading @@ -293,16 +293,19 @@ module JsDuck s.merge!(defaults) docset = find_docset(p) if docset docset[:code] = s else if !docset || docset[:type] != :doc_comment if defaults[:inheritable] s[:inheritdoc] = {} else s[:private] = true end s[:autodetected] = true end if docset docset[:code] = s else s[:linenr] = p["range"][2] statics << s end Loading spec/aggregator_static_spec.rb +28 −0 Original line number Diff line number Diff line Loading @@ -199,4 +199,32 @@ describe JsDuck::Aggregator do end end describe "Ext.define() with line-comment before item in statics:" do let(:methods) do parse(<<-EOS)[0][:statics][:method] /** * Some documentation. */ Ext.define("MyClass", { statics: { // Check this out bar: function() {} } }); EOS end it "detects one static method" do methods.length.should == 1 end it "detects documentation" do methods[0][:doc].should == "Check this out" end it "detects the method with :autodetected flag" do methods[0][:autodetected].should == true end end end Loading
lib/jsduck/ast.rb +7 −4 Original line number Diff line number Diff line Loading @@ -293,16 +293,19 @@ module JsDuck s.merge!(defaults) docset = find_docset(p) if docset docset[:code] = s else if !docset || docset[:type] != :doc_comment if defaults[:inheritable] s[:inheritdoc] = {} else s[:private] = true end s[:autodetected] = true end if docset docset[:code] = s else s[:linenr] = p["range"][2] statics << s end Loading
spec/aggregator_static_spec.rb +28 −0 Original line number Diff line number Diff line Loading @@ -199,4 +199,32 @@ describe JsDuck::Aggregator do end end describe "Ext.define() with line-comment before item in statics:" do let(:methods) do parse(<<-EOS)[0][:statics][:method] /** * Some documentation. */ Ext.define("MyClass", { statics: { // Check this out bar: function() {} } }); EOS end it "detects one static method" do methods.length.should == 1 end it "detects documentation" do methods[0][:doc].should == "Check this out" end it "detects the method with :autodetected flag" do methods[0][:autodetected].should == true end end end