Project

General

Profile

Actions

Bug #1219

closed

ostruct freeze still not stable

Added by RobertDober (Robert Dober) about 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
Backport:
[ruby-core:22559]

Description

=begin
Freezing an ostruct still does not inhibit modification as can be seen in the attached test file and in the following example

o = OpenStruct::new :a => 42
OpenStruct.module_eval do def frozen?; nil end end
o.freeze
o.a = 1764

forwarding freeze to the table or a proxy object that has to change on any update seems necessary. Idea Joël VanderWerf!
=end


Files

ostruct.patch (1.26 KB) ostruct.patch The patch for lib/ostruct.rb RobertDober (Robert Dober), 02/27/2009 06:11 AM
test_ostruct.patch (983 Bytes) test_ostruct.patch The patch for test/ostruct/test_ostruct.rb RobertDober (Robert Dober), 02/27/2009 06:11 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0