lib/mutant/mutator/node.rb in mutant-0.3.0.beta9 vs lib/mutant/mutator/node.rb in mutant-0.3.0.beta10
- old
+ new
@@ -121,12 +121,11 @@
# @return [undefined]
#
# @api private
#
def mutate_child(index, mutator = Mutator)
- children = node.children
- child = children[index]
+ child = children.at(index)
mutator.each(child, self) do |mutation|
emit_child_update(index, mutation)
end
end
@@ -145,18 +144,18 @@
end
# Emit updated child
#
# @param [Fixnum] index
- # @param [Object] update
+ # @param [Parser::AST::Node] node
#
# @return [undefined]
#
# @api private
#
- def emit_child_update(index, update)
+ def emit_child_update(index, node)
new_children = children.dup
- new_children[index]=update
+ new_children[index]=node
emit_self(*new_children)
end
# Emit a new AST node with same class as wrapped node
#