jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-1872

next statement should return the argument passed, not nil

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM

Punting issues from 1.1 RC2 to 1.1 final.

Show
Charles Oliver Nutter added a comment - 15/Feb/08 12:58 PM Punting issues from 1.1 RC2 to 1.1 final.
Hide
Permalink
Charles Oliver Nutter added a comment - 17/Mar/08 4:35 PM

Nontrivial non-local flow control bug. Also never reported in the wild as a problem. Post 1.1.

Show
Charles Oliver Nutter added a comment - 17/Mar/08 4:35 PM Nontrivial non-local flow control bug. Also never reported in the wild as a problem. Post 1.1.
Hide
Permalink
Charles Oliver Nutter added a comment - 04/Feb/09 3:37 AM

Fixed in r8991.

Show
Charles Oliver Nutter added a comment - 04/Feb/09 3:37 AM Fixed in r8991.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Vladimir Sizikov
Vote (0)
Watch (1)

Dates

  • Created:
    03/Jan/08 4:00 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    04/Feb/09 3:37 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.