History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1876
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Vladimir Sizikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Array#initialize should not modify frozen array

Created: 03/Jan/08 08:03 AM   Updated: 23/Apr/08 10:03 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.1+
Fix Version/s: JRuby 1.1RC1

Time Tracking:
Not Specified

File Attachments: 1. Text File array-initialize-frozen.patch (1 kb)

Environment: Latest JRuby 1.1b1

Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
Consider the following example:
[1, 2, 3].freeze.instance_eval { initialize }

On JRuby, this basically clears the frozen array.

On the latest MRI 1.8.6, the code above leads to TypeError.

This also leads to a rubyspec failure for Array.

The proposed patch (with regression test) fixes the problem.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Thomas E Enebo - 03/Jan/08 01:15 PM
Fixed in commit 5478 on trunk (patch by Vladimir Sizikov)