97a75dd062
This is a reaction to the to_source rewrite * Do not use 1.8 specific nodes anymore * Do not generate AST nodes that would not be generatable from source
32 lines
597 B
Ruby
32 lines
597 B
Ruby
module Mutant
|
|
class Mutator
|
|
class Node
|
|
# Mutator on AST blocks
|
|
class Block < self
|
|
|
|
handle(Rubinius::AST::Block)
|
|
|
|
private
|
|
|
|
# Emit mutants
|
|
#
|
|
# @return [undefined]
|
|
#
|
|
# @api private
|
|
#
|
|
def dispatch
|
|
array = input.array
|
|
emit_attribute_mutations(:array) do |mutation|
|
|
array = mutation.array
|
|
# Do not generate empty bodies
|
|
if array.empty?
|
|
array << new_nil
|
|
end
|
|
mutation
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|