Use child nameing in return mutator
This commit is contained in:
parent
c62b1fc9df
commit
10c611f5e3
1 changed files with 2 additions and 3 deletions
|
@ -6,7 +6,7 @@ module Mutant
|
|||
|
||||
handle(:return)
|
||||
|
||||
VALUE_INDEX = 0
|
||||
children :value
|
||||
|
||||
private
|
||||
|
||||
|
@ -17,10 +17,9 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def dispatch
|
||||
value = children.first
|
||||
if value
|
||||
emit(value)
|
||||
mutate_child(VALUE_INDEX)
|
||||
emit_value_mutations
|
||||
else
|
||||
emit_nil
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue