Loading lib/jsduck/ast.rb +2 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ module JsDuck when "inheritableStatics" cls[:statics] += make_statics(value, {:inheritable => true}) else if value["type"] == "FunctionExpression" if function?(value) m = make_method(key, value) cls[:members] << m if apply_autodetected(m, pair) else Loading Loading @@ -291,7 +291,7 @@ module JsDuck statics = [] each_pair_in_object_expression(ast) do |name, value, pair| if value["type"] == "FunctionExpression" if function?(value) s = make_method(name, value) else s = make_property(name, value) Loading spec/aggregator_method_spec.rb +17 −0 Original line number Diff line number Diff line Loading @@ -219,4 +219,21 @@ describe JsDuck::Aggregator do end end describe "property with value Ext.emptyFn inside Ext.define" do let(:method) do parse(<<-EOS)[0][:members][:method][0] /** * Some documentation. */ Ext.define("MyClass", { foo: Ext.emptyFn }); EOS end it "detects a method" do method[:tagname].should == :method end end end spec/aggregator_static_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -227,4 +227,23 @@ describe JsDuck::Aggregator do end end describe "Ext.define() with property having value Ext.emptyFn in statics:" do let(:methods) do parse(<<-EOS)[0][:statics][:method] /** * Some documentation. */ Ext.define("MyClass", { statics: { bar: Ext.emptyFn } }); EOS end it "detects one static method" do methods.length.should == 1 end end end Loading
lib/jsduck/ast.rb +2 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ module JsDuck when "inheritableStatics" cls[:statics] += make_statics(value, {:inheritable => true}) else if value["type"] == "FunctionExpression" if function?(value) m = make_method(key, value) cls[:members] << m if apply_autodetected(m, pair) else Loading Loading @@ -291,7 +291,7 @@ module JsDuck statics = [] each_pair_in_object_expression(ast) do |name, value, pair| if value["type"] == "FunctionExpression" if function?(value) s = make_method(name, value) else s = make_property(name, value) Loading
spec/aggregator_method_spec.rb +17 −0 Original line number Diff line number Diff line Loading @@ -219,4 +219,21 @@ describe JsDuck::Aggregator do end end describe "property with value Ext.emptyFn inside Ext.define" do let(:method) do parse(<<-EOS)[0][:members][:method][0] /** * Some documentation. */ Ext.define("MyClass", { foo: Ext.emptyFn }); EOS end it "detects a method" do method[:tagname].should == :method end end end
spec/aggregator_static_spec.rb +19 −0 Original line number Diff line number Diff line Loading @@ -227,4 +227,23 @@ describe JsDuck::Aggregator do end end describe "Ext.define() with property having value Ext.emptyFn in statics:" do let(:methods) do parse(<<-EOS)[0][:statics][:method] /** * Some documentation. */ Ext.define("MyClass", { statics: { bar: Ext.emptyFn } }); EOS end it "detects one static method" do methods.length.should == 1 end end end