Skip to content

Commit

Permalink
Skip instances of BasicObject
Browse files Browse the repository at this point in the history
The other checks assume that the object under consideration descends from Object and can fail if the object descends from BasicObject instead.
  • Loading branch information
jcoleman committed Oct 28, 2013
1 parent 306e7a0 commit e1df7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/object_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def traverse_reference_graph(obj)
found.replace ObjectSpace.find_references(obj)
found.each do |o|
# Exclude the traversal algorithm and references from the source code from the graph.
next if self.equal?(o) || found.equal?(o) || seen.equal?(o) || edges.include?(o) || Thread.current.equal?(o) || RubyVM::InstructionSequence === o || o.class == ObjectGraph::ToSee
next if !(Object === o) || self.equal?(o) || found.equal?(o) || seen.equal?(o) || edges.include?(o) || Thread.current.equal?(o) || RubyVM::InstructionSequence === o || o.class == ObjectGraph::ToSee
edges << [o, obj] unless obj.equal?(o)
next if seen.include?(o)
seen << o
Expand Down

0 comments on commit e1df7f8

Please sign in to comment.