Files
metasploit-gs/lib/rkelly/nodes/resolve_node.rb
T
James Lee 7458abc8b3 add rkelly, a javascript parsing library. this version fixes several bugs in the abandoned gem, see https://github.com/tenderlove/rkelly/pull/6
git-svn-id: file:///home/svn/framework3/trunk@12815 4d416f70-5f16-0410-b530-b9f4589650da
2011-06-02 06:31:34 +00:00

20 lines
494 B
Ruby

module RKelly
module Nodes
class ResolveNode < Node
def ==(other)
return true if super
if @value =~ /^[A-Z]/
place = [Object, Module, RKelly::Nodes].find { |x|
x.const_defined?(@value.to_sym)
}
return false unless place
klass = place.const_get(@value.to_sym)
return true if klass && other.is_a?(klass) || other.value.is_a?(klass)
end
false
end
alias :=~ :==
end
end
end