next statement should return the argument passed, not nil
---------------------------------------------------------

                 Key: JRUBY-1872
                 URL: http://jira.codehaus.org/browse/JRUBY-1872
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Latest JRuby 1.1b1 from trunk
            Reporter: Vladimir Sizikov


The following example:

{noformat}
p lambda { 123; next 234; 345 }.call
{noformat}

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.



-- 
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

Reply via email to