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

'attr' implementation is incompatible with MRI 1.9.1 behavior

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.2
  • Fix Version/s: JRuby 1.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu Linux 8.04, 32-bit x86
  • Patch Submitted:
    Yes

Description

MRI 1.8's Module#attr method has the following signature:

Module#attr(symbol_name, writable = false)

In MRI 1.9.1, this has been changed to:

Module#attr(symbol_name, ...)

1.9.1 allows one to define multiple attributes with #attr, all writable:

attr :foo, :bar, :baz

JRuby still implements the old 1.8 behavior, even when in 1.9 mode. This prevents irb from starting.

The attached patch fixes this problem.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    jruby-attr-1.9-compatibility.diff
    05/Feb/09 4:45 AM
    1 kB
    Hongli Lai
  2. File
    jruby-attr-1.9-compatibility-2.diff
    05/Feb/09 5:20 AM
    0.7 kB
    Hongli Lai

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 05/Feb/09 5:14 AM

Committed in r9013. Thanks for the patch!

Show
Charles Oliver Nutter added a comment - 05/Feb/09 5:14 AM Committed in r9013. Thanks for the patch!
Hide
Permalink
Hongli Lai added a comment - 05/Feb/09 5:20 AM

I made a mistake: 'attr' does not create setters. Here's another patch which fixes this problem.

Show
Hongli Lai added a comment - 05/Feb/09 5:20 AM I made a mistake: 'attr' does not create setters. Here's another patch which fixes this problem.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Hongli Lai
Vote (0)
Watch (0)

Dates

  • Created:
    05/Feb/09 4:45 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    05/Feb/09 5:14 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.