lib/mutant/mutator/node/define.rb in mutant-0.11.11 vs lib/mutant/mutator/node/define.rb in mutant-0.11.12
- old
+ new
@@ -11,11 +11,14 @@
def dispatch
emit_arguments_mutations
emit_optarg_body_assignments
emit_body(N_RAISE)
emit_body(N_ZSUPER)
- emit_body(nil)
- emit_body_mutations if body
+
+ return unless body && !ignore?(body)
+
+ emit_body(nil) unless body.children.any?(&method(:ignore?))
+ emit_body_mutations
end
def emit_optarg_body_assignments
arguments.children.each do |argument|
next unless n_optarg?(argument) && AST::Meta::Optarg.new(argument).used?