Loading lib/jsduck/ast.rb +1 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ module JsDuck elsif ext_define?(ast) cfg = object_expression_to_hash(ast["arguments"][1]) cls[:extends] = make_extends(cfg["extend"]) cls[:extends] = make_extends(cfg["extend"]) || "Ext.Base" cls[:requires] = make_requires(cfg["requires"]) cls[:uses] = make_requires(cfg["uses"]) cls[:alternateClassNames] = make_requires(cfg["alternateClassName"]) Loading spec/ast_class_spec.rb +7 −7 Original line number Diff line number Diff line Loading @@ -68,11 +68,9 @@ describe "JsDuck::Ast detects class with" do }); EOS end end describe "no extends in" do it "Ext.define() with function argument" do detect(<<-EOS)[:extends].should == nil detect(<<-EOS)[:extends].should == "Ext.Base" /** */ Ext.define('MyClass', function() { }); Loading @@ -80,7 +78,7 @@ describe "JsDuck::Ast detects class with" do end it "Ext.define() with no extend: in config object" do detect(<<-EOS)[:extends].should == nil detect(<<-EOS)[:extends].should == "Ext.Base" /** */ Ext.define('MyClass', { foo: 5, Loading @@ -88,13 +86,15 @@ describe "JsDuck::Ast detects class with" do }); EOS end end it "Ext.define() with extend as number" do describe "no extends in" do it "plain variable assignment" do detect(<<-EOS)[:extends].should == nil /** */ Ext.define('MyClass', { MyClass = { extend: 5 }); }; EOS end end Loading Loading
lib/jsduck/ast.rb +1 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ module JsDuck elsif ext_define?(ast) cfg = object_expression_to_hash(ast["arguments"][1]) cls[:extends] = make_extends(cfg["extend"]) cls[:extends] = make_extends(cfg["extend"]) || "Ext.Base" cls[:requires] = make_requires(cfg["requires"]) cls[:uses] = make_requires(cfg["uses"]) cls[:alternateClassNames] = make_requires(cfg["alternateClassName"]) Loading
spec/ast_class_spec.rb +7 −7 Original line number Diff line number Diff line Loading @@ -68,11 +68,9 @@ describe "JsDuck::Ast detects class with" do }); EOS end end describe "no extends in" do it "Ext.define() with function argument" do detect(<<-EOS)[:extends].should == nil detect(<<-EOS)[:extends].should == "Ext.Base" /** */ Ext.define('MyClass', function() { }); Loading @@ -80,7 +78,7 @@ describe "JsDuck::Ast detects class with" do end it "Ext.define() with no extend: in config object" do detect(<<-EOS)[:extends].should == nil detect(<<-EOS)[:extends].should == "Ext.Base" /** */ Ext.define('MyClass', { foo: 5, Loading @@ -88,13 +86,15 @@ describe "JsDuck::Ast detects class with" do }); EOS end end it "Ext.define() with extend as number" do describe "no extends in" do it "plain variable assignment" do detect(<<-EOS)[:extends].should == nil /** */ Ext.define('MyClass', { MyClass = { extend: 5 }); }; EOS end end Loading