Wrong precedence for defined? and &&=, ||=
------------------------------------------
Key: JRUBY-4141
URL: http://jira.codehaus.org/browse/JRUBY-4141
Project: JRuby
Issue Type: Bug
Components: RubySpec
Affects Versions: JRuby 1.4.0RC2
Environment: jruby 1.5.0dev (ruby 1.8.7 patchlevel 174) (2009-10-22
dbe8b6c) (Java HotSpot(TM) Client VM 1.6.0_03) [i386-java]
Reporter: Vladimir Sizikov
Looks like MRI's behavior has been changed as well, compared to 1.8.6. So,
JRuby now behaves as 1.8.6, but differs from 1.8.7 and 1.9. Since we target
1.8.7, we should adjust the behavior here.
{code}
/ruby -ve "p defined? a&&= 1"
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
"assignment"
{code}
but in JRuby:
{code}
jruby -ve "p defined? a&&= 1"
jruby 1.5.0dev (ruby 1.8.7 patchlevel 174) (2009-10-22 dbe8b6c) (Java
HotSpot(TM) Client VM 1.6.0_03) [i386-java]
"expression"
{code}
The same is for ||=.
This causes some new RubySpec failures:
{noformat}
1)
Operators = %= /= -= += |= &= >>= <<= *= &&= ||= **= have higher precedence
than defined? operator FAILED
Expected "expression"
to equal "assignment"
/opt/work/rubyspec.git/language/precedence_spec.rb:441
/opt/work/rubyspec.git/language/precedence_spec.rb:97
/opt/work/rubyspec.git/language/precedence_spec.rb:55:in `load'
/opt/work/mspec.git/bin/mspec-run:8
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email