Fix right hand blindspot for or-assgns

Fixes #421
This commit is contained in:
John Backus 2015-08-19 17:59:37 -04:00
parent 0fa3999d85
commit 229128467c
2 changed files with 9 additions and 1 deletions

View file

@ -158,7 +158,6 @@ module Mutant
emit_receiver(nil) if n_self?(receiver) && !(
KEYWORDS.include?(selector) ||
METHOD_OPERATORS.include?(selector) ||
OP_ASSIGN.include?(parent_type) ||
meta.attribute_assignment?
)
end

View file

@ -21,6 +21,15 @@ Mutant::Meta::Example.add do
mutation '@a ||= 2'
end
Mutant::Meta::Example.add do
source '@a ||= self.bar'
singleton_mutations
mutation '@a ||= nil'
mutation '@a ||= self'
mutation '@a ||= bar'
end
Mutant::Meta::Example.add do
source 'foo[:bar] ||= 1'