Move emit body mutations to base class

This commit is contained in:
Markus Schirp 2012-08-14 12:40:27 +02:00
parent 835b069306
commit 3e23c9258f
3 changed files with 15 additions and 18 deletions

View file

@ -234,6 +234,20 @@ module Mutant
end
end
# Emit body mutations
#
# @return [undefined]
#
# @api private
#
def emit_body_mutations
Mutator.each(node.body) do |mutation|
node = dup_node
node.body = mutation
emit_unsafe(node)
end
end
# Emit element mutations
#
# @param [Array] elements

View file

@ -13,11 +13,7 @@ module Mutant
# @api private
#
def dispatch
Mutator.each(node.body) do |mutation|
node = dup_node
node.body = mutation
emit_safe(node)
end
emit_body_mutations
end
end
end

View file

@ -17,19 +17,6 @@ module Mutant
emit_body_mutations
end
# Emit body mutations
#
# @return [undefined]
#
# @api private
#
def emit_body_mutations
Mutator.each(node.body) do |mutation|
node = dup_node
node.body = mutation
emit_unsafe(node)
end
end
end
# Mutator for Rubinius::AST::ReceiverCase nodes