Actions
Bug #16826
closedObjectSpace::WeakMap#key? returns false if value is nil
Description
$ ruby -e 'map=ObjectSpace::WeakMap.new; map[:foo] = 4; p map; p map.key? :foo'
#<ObjectSpace::WeakMap:0x000055fbe0c38c00: :foo => 4>
true # OK
$ ruby -e 'map=ObjectSpace::WeakMap.new; map[:foo] = nil; p map; p map.key? :foo'
#<ObjectSpace::WeakMap:0x000056371e3f86e8: :foo => nil>
false # BUG
Updated by Eregon (Benoit Daloze) over 4 years ago
- Assignee set to Eregon (Benoit Daloze)
I'll fix this.
Updated by Eregon (Benoit Daloze) over 4 years ago
- Status changed from Open to Closed
Applied in changeset git|a2be428c5fec31b8adbd5ac087e7637ddf7e54d0.
Fix ObjectSpace::WeakMap#key? to work if the value is nil
- Fixes [Bug #16826]
Updated by nagachika (Tomoyuki Chikanaga) about 4 years ago
- Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE
ruby_2_7 9da6470d7b3aa136b4b92469c8bbc522beb1ac31 merged revision(s) a2be428c5fec31b8adbd5ac087e7637ddf7e54d0.
Actions
Like0
Like0Like0Like0