Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.x+
-
Fix Version/s: JRuby 1.2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Latest JRuby 1.1b1 from trunk
Description
The following example:
p lambda { 123; next 234; 345 }.call
prints 234 in MRI 1.8.6, 1,9, Rubinius.
Prints nil in JRuby.
This also causes a rubinius spec failure:
The next statement returns the argument passed FAILED
Expected nil to equal 234:
./mspec/expectations.rb:10:in `fail_with'
./mspec/matchers/base.rb:8:in `=='
/opt/work/rubinius/./spec/ruby/1.8/language/next_spec.rb:32:in `=='
/opt/work/rubinius/./spec/ruby/1.8/language/next_spec.rb:32:in `call'
./mspec/runner/runner.rb:136:in `describe'
./mspec/runner/runner.rb:135:in `each'
./mspec/runner/runner.rb:130:in `describe'
./mspec/runner/runner.rb:135:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/language/next_spec.rb:3:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/language/next_spec.rb:3:in `load'
tmp/last_mspec.rb:15:in `load'
tmp/last_mspec.rb:10:in `each'
tmp/last_mspec.rb:10:in `each'
The spec started to fail right after r5468: "Update to 1.8.6. We already have modeled many methods after 1.8.6",
due to fact that this behavior is tested only on MRI 1.8.6. MRI 1.8.5 was returning nil.
So, if we are to be compatible with MRI 1.8.6, we should adjust the behavior and not return nil in this case.
Punting issues from 1.1 RC2 to 1.1 final.