Loading lib/jsduck/js_parser.rb +6 −2 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ module JsDuck var_declaration elsif look("Ext", ".", "define", "(", :string) ext_define elsif look("Ext", ".", "ClassManager", ".", "create", "(", :string) ext_define elsif look(:ident, ":") || look(:string, ":") property_literal elsif look(",", :ident, ":") || look(",", :string, ":") Loading Loading @@ -178,9 +180,11 @@ module JsDuck } end # <ext-define> := "Ext" "." "define" "(" <string> "," <ext-define-cfg> # <ext-define> := "Ext" "." ["define" | "ClassManager" "." "create" ] "(" <string> "," <ext-define-cfg> def ext_define name = match("Ext", ".", "define", "(", :string) match("Ext", "."); look("define") ? match("define") : match("ClassManager", ".", "create"); name = match("(", :string) if look(",", "{") match(",") Loading spec/aggregator_classes_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,17 @@ describe JsDuck::Aggregator do it_should_behave_like "Ext.define" end describe "Ext.ClassManager.create() instead of Ext.define()" do before do @doc = parse(<<-EOS)[0] /** */ Ext.ClassManager.create('MyClass', { }); EOS end it_should_behave_like "class" end describe "complex Ext.define() in code" do before do @doc = parse(<<-EOS)[0] Loading Loading
lib/jsduck/js_parser.rb +6 −2 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ module JsDuck var_declaration elsif look("Ext", ".", "define", "(", :string) ext_define elsif look("Ext", ".", "ClassManager", ".", "create", "(", :string) ext_define elsif look(:ident, ":") || look(:string, ":") property_literal elsif look(",", :ident, ":") || look(",", :string, ":") Loading Loading @@ -178,9 +180,11 @@ module JsDuck } end # <ext-define> := "Ext" "." "define" "(" <string> "," <ext-define-cfg> # <ext-define> := "Ext" "." ["define" | "ClassManager" "." "create" ] "(" <string> "," <ext-define-cfg> def ext_define name = match("Ext", ".", "define", "(", :string) match("Ext", "."); look("define") ? match("define") : match("ClassManager", ".", "create"); name = match("(", :string) if look(",", "{") match(",") Loading
spec/aggregator_classes_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,17 @@ describe JsDuck::Aggregator do it_should_behave_like "Ext.define" end describe "Ext.ClassManager.create() instead of Ext.define()" do before do @doc = parse(<<-EOS)[0] /** */ Ext.ClassManager.create('MyClass', { }); EOS end it_should_behave_like "class" end describe "complex Ext.define() in code" do before do @doc = parse(<<-EOS)[0] Loading