Move emit body mutations to base class
This commit is contained in:
parent
835b069306
commit
3e23c9258f
3 changed files with 15 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue