Loading lib/jsduck/parser.rb +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ module JsDuck var_declaration elsif look(:ident, ":") || look(:string, ":") then property_literal elsif look(",", :ident, ":") || look(",", :string, ":") then match(",") property_literal elsif look(:ident) || look("this") then maybe_assignment elsif look(:string) then Loading spec/aggregator_cfgs_and_properties_spec.rb +13 −0 Original line number Diff line number Diff line Loading @@ -246,4 +246,17 @@ describe JsDuck::Aggregator do end end describe "comma-first style" do before do @doc = parse(<<-EOS)[0] /** * Some documentation. */ ,foo: "" EOS end it_should_behave_like "property" it_should_behave_like "cfg or property" end end spec/aggregator_methods_and_events_spec.rb +7 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,13 @@ describe JsDuck::Aggregator do it_should_behave_like "method documentation" end describe "function-literal in comma-first style" do before do @doc = parse("/** Some function */ , foo: function() {}")[0] end it_should_behave_like "method documentation" end describe "explicit @method without @param-s" do before do @doc = parse(<<-EOS)[0] Loading Loading
lib/jsduck/parser.rb +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ module JsDuck var_declaration elsif look(:ident, ":") || look(:string, ":") then property_literal elsif look(",", :ident, ":") || look(",", :string, ":") then match(",") property_literal elsif look(:ident) || look("this") then maybe_assignment elsif look(:string) then Loading
spec/aggregator_cfgs_and_properties_spec.rb +13 −0 Original line number Diff line number Diff line Loading @@ -246,4 +246,17 @@ describe JsDuck::Aggregator do end end describe "comma-first style" do before do @doc = parse(<<-EOS)[0] /** * Some documentation. */ ,foo: "" EOS end it_should_behave_like "property" it_should_behave_like "cfg or property" end end
spec/aggregator_methods_and_events_spec.rb +7 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,13 @@ describe JsDuck::Aggregator do it_should_behave_like "method documentation" end describe "function-literal in comma-first style" do before do @doc = parse("/** Some function */ , foo: function() {}")[0] end it_should_behave_like "method documentation" end describe "explicit @method without @param-s" do before do @doc = parse(<<-EOS)[0] Loading