2012-12-06 15:30:28 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
class Literal < self
|
|
|
|
# Mutator for array literals
|
|
|
|
class Array < self
|
|
|
|
|
|
|
|
handle(Rubinius::AST::ArrayLiteral)
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
2012-12-06 16:30:57 -05:00
|
|
|
emit_attribute_mutations(:body)
|
2012-12-06 15:30:28 -05:00
|
|
|
emit_self([])
|
2012-12-06 16:30:57 -05:00
|
|
|
emit_nil
|
|
|
|
emit_self(node.body.dup << new_nil)
|
2012-12-06 15:30:28 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|