Loading lib/jsduck/js_parser.rb +9 −3 Original line number Diff line number Diff line Loading @@ -270,12 +270,18 @@ module JsDuck end end # <mixins> := "mixins" ":" <object-literal> # <mixins> := "mixins" ":" [ <object-literal> | <array-literal> ] def ext_define_mixins if look("mixins", ":", "{") if look("mixins", ":") match("mixins", ":") lit = literal lit && lit[:value].map {|x| x[:value][:value] } if lit && lit[:type] == :object lit[:value].map {|x| x[:value][:value] } elsif lit && lit[:type] == :array lit[:value].map {|x| x[:value] } else nil end end end Loading spec/aggregator_classes_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -256,10 +256,10 @@ describe JsDuck::Aggregator do alternateClassName: ['JustClass'], stuff: ["foo", "bar"], requires: ['ClassA', 'ClassB'], mixins: { obs: 'Ext.util.Observable', bar: 'Foo.Bar' } mixins: [ 'Ext.util.Observable', 'Foo.Bar' ] }); EOS end Loading Loading
lib/jsduck/js_parser.rb +9 −3 Original line number Diff line number Diff line Loading @@ -270,12 +270,18 @@ module JsDuck end end # <mixins> := "mixins" ":" <object-literal> # <mixins> := "mixins" ":" [ <object-literal> | <array-literal> ] def ext_define_mixins if look("mixins", ":", "{") if look("mixins", ":") match("mixins", ":") lit = literal lit && lit[:value].map {|x| x[:value][:value] } if lit && lit[:type] == :object lit[:value].map {|x| x[:value][:value] } elsif lit && lit[:type] == :array lit[:value].map {|x| x[:value] } else nil end end end Loading
spec/aggregator_classes_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -256,10 +256,10 @@ describe JsDuck::Aggregator do alternateClassName: ['JustClass'], stuff: ["foo", "bar"], requires: ['ClassA', 'ClassB'], mixins: { obs: 'Ext.util.Observable', bar: 'Foo.Bar' } mixins: [ 'Ext.util.Observable', 'Foo.Bar' ] }); EOS end Loading