Fix invalid AST generation on operator method with self as receiver
This commit is contained in:
parent
3a84968c95
commit
3d94003616
3 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
# v0.5.22 2014-06-15
|
||||
|
||||
* Fix invalid AST generation on operator method mutation with self as receiver.
|
||||
|
||||
# v0.5.21 2014-06-15
|
||||
|
||||
* Readd mutation of index assignments
|
||||
|
|
|
@ -170,8 +170,9 @@ module Mutant
|
|||
#
|
||||
def emit_implicit_self
|
||||
emit_receiver(nil) if n_self?(receiver) && !(
|
||||
KEYWORDS.include?(selector) ||
|
||||
OP_ASSIGN.include?(parent_type) ||
|
||||
KEYWORDS.include?(selector) ||
|
||||
METHOD_OPERATORS.include?(selector) ||
|
||||
OP_ASSIGN.include?(parent_type) ||
|
||||
attribute_assignment?
|
||||
)
|
||||
end
|
||||
|
|
10
meta/send.rb
10
meta/send.rb
|
@ -235,6 +235,16 @@ Mutant::Meta::Example.add do
|
|||
mutation 'foo[]'
|
||||
end
|
||||
|
||||
Mutant::Meta::Example.add do
|
||||
source 'self[foo]'
|
||||
|
||||
singleton_mutations
|
||||
mutation 'self[self]'
|
||||
mutation 'self[nil]'
|
||||
mutation 'self[]'
|
||||
mutation 'foo'
|
||||
end
|
||||
|
||||
Mutant::Meta::Example.add do
|
||||
source 'foo[*bar]'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue