Actions
Bug #10024
closedArray injection of ternary operators injects boolean rather than ternary result
Description
The following code:
a = []
a << ''.blank? ? 'blank' : 'not blank'
puts a
renders [true]
.
I would expect it to render ['blank']
If I wrap it in parenthesis it does work.
a = []
a << ( ''.blank? ? 'blank' : 'not blank' )
puts a # ['blank']
it seems like the logic internally is perceiving this function as:
(a << ''.blank?) ? 'blank' : 'not blank'
Which seems illogical.
Actions
Like0
Like0Like0