Loading lib/jsduck/ast.rb +2 −2 Original line number Diff line number Diff line Loading @@ -244,8 +244,8 @@ module JsDuck if docset docset[:code] = cfg else cfg[:inheritdoc] = {:no_warnings => true} cfg[:private] = :inherit cfg[:inheritdoc] = {} cfg[:autodetected] = true configs << cfg end end Loading lib/jsduck/inherit_doc.rb +4 −6 Original line number Diff line number Diff line Loading @@ -39,10 +39,8 @@ module JsDuck # For auto-detected members/classes (which have @private == :inherit) # Use the visibility from parent class (defaulting to private when no parent). def resolve_visibility(m, parent) if m[:private] == :inherit if parent m[:meta][:private] = m[:private] = parent[:private] else if m[:autodetected] if !parent || parent[:private] m[:meta][:private] = m[:private] = true end end Loading Loading @@ -74,7 +72,7 @@ module JsDuck # Warn when no parent or mixins at all if !parent_cls && mixins.length == 0 warn("parent class not found", m) unless inherit[:no_warnings] warn("parent class not found", m) unless m[:autodetected] return nil end Loading @@ -93,7 +91,7 @@ module JsDuck # Only when both parent and mixins fail, throw warning if !parent warn("parent member not found", m) unless inherit[:no_warnings] warn("parent member not found", m) unless m[:autodetected] return nil end end Loading lib/jsduck/merger.rb +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ module JsDuck # Copy private to meta h[:meta][:private] = h[:private] if h[:private] # Remember auto-detection info h[:autodetected] = code[:autodetected] if code[:autodetected] h end Loading spec/aggregator_cfg_spec.rb +3 −9 Original line number Diff line number Diff line Loading @@ -33,17 +33,11 @@ describe JsDuck::Aggregator do end it "sets :inheritdoc flag on config" do cfg[0][:inheritdoc].should == {:no_warnings => true} cfg[0][:inheritdoc].should == {} end # The inheriting of :private will be solved by InheritDoc class. it "sets :private flag on config is :inherit" do cfg[0][:private].should == :inherit end it "sets :private flag on config is :inherit (meta)" do cfg[0][:meta][:private].should == :inherit it "sets :autodetected flag on config" do cfg[0][:autodetected].should == true end end Loading Loading
lib/jsduck/ast.rb +2 −2 Original line number Diff line number Diff line Loading @@ -244,8 +244,8 @@ module JsDuck if docset docset[:code] = cfg else cfg[:inheritdoc] = {:no_warnings => true} cfg[:private] = :inherit cfg[:inheritdoc] = {} cfg[:autodetected] = true configs << cfg end end Loading
lib/jsduck/inherit_doc.rb +4 −6 Original line number Diff line number Diff line Loading @@ -39,10 +39,8 @@ module JsDuck # For auto-detected members/classes (which have @private == :inherit) # Use the visibility from parent class (defaulting to private when no parent). def resolve_visibility(m, parent) if m[:private] == :inherit if parent m[:meta][:private] = m[:private] = parent[:private] else if m[:autodetected] if !parent || parent[:private] m[:meta][:private] = m[:private] = true end end Loading Loading @@ -74,7 +72,7 @@ module JsDuck # Warn when no parent or mixins at all if !parent_cls && mixins.length == 0 warn("parent class not found", m) unless inherit[:no_warnings] warn("parent class not found", m) unless m[:autodetected] return nil end Loading @@ -93,7 +91,7 @@ module JsDuck # Only when both parent and mixins fail, throw warning if !parent warn("parent member not found", m) unless inherit[:no_warnings] warn("parent member not found", m) unless m[:autodetected] return nil end end Loading
lib/jsduck/merger.rb +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ module JsDuck # Copy private to meta h[:meta][:private] = h[:private] if h[:private] # Remember auto-detection info h[:autodetected] = code[:autodetected] if code[:autodetected] h end Loading
spec/aggregator_cfg_spec.rb +3 −9 Original line number Diff line number Diff line Loading @@ -33,17 +33,11 @@ describe JsDuck::Aggregator do end it "sets :inheritdoc flag on config" do cfg[0][:inheritdoc].should == {:no_warnings => true} cfg[0][:inheritdoc].should == {} end # The inheriting of :private will be solved by InheritDoc class. it "sets :private flag on config is :inherit" do cfg[0][:private].should == :inherit end it "sets :private flag on config is :inherit (meta)" do cfg[0][:meta][:private].should == :inherit it "sets :autodetected flag on config" do cfg[0][:autodetected].should == true end end Loading