free_mutant/lib/mutant/mutator/node/super.rb

54 lines
1,004 B
Ruby
Raw Normal View History

2013-01-01 17:28:21 -05:00
module Mutant
class Mutator
class Node
class ZSuper < self
handle(Rubinius::AST::ZSuper)
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_node(Rubinius::AST::Super, new(Rubinius::AST::ActualArguments))
end
end
class Super < self
handle(Rubinius::AST::Super)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_node(Rubinius::AST::ZSuper)
2013-01-01 19:04:16 -05:00
emit_without_block
emit_attribute_mutations(:block) if node.block
emit_attribute_mutations(:arguments)
end
# Emit without block mutation
#
# @return [undefined]
#
# @api private
#
def emit_without_block
dup = dup_node
dup.block = nil
emit(dup)
2013-01-01 17:28:21 -05:00
end
end
end
end
end