mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Frozen objects in WeakMap
* gc.c (wmap_aset): bypass check for frozen and allow frozen object in WeakMap. [Bug #13498]
This commit is contained in:
parent
f5e2904471
commit
f3c81b4e90
2 changed files with 16 additions and 3 deletions
|
@ -141,4 +141,10 @@ class TestWeakMap < Test::Unit::TestCase
|
|||
assert_equal(2, @wm.__send__(m))
|
||||
end
|
||||
alias test_length test_size
|
||||
|
||||
def test_frozen_object
|
||||
o = Object.new.freeze
|
||||
assert_nothing_raised(FrozenError) {@wm[o] = 'foo'}
|
||||
assert_nothing_raised(FrozenError) {@wm['foo'] = o}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue