diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 23:27:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-22 23:27:33 +0000 |
commit | 3256a4dc214610884c0eb1e72b0d12242536d7e5 (patch) | |
tree | 254c4bf0b241f4a0f575bee5353f7b457a78c617 /hash.c | |
parent | fb014572650bc333c3c4ffe6b1179d443b7f03c3 (diff) | |
download | ruby-3256a4dc214610884c0eb1e72b0d12242536d7e5.tar.gz |
* hash.c (env_aset): allow nil value to remove an entry.
[ruby-dev:36465]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2052,7 +2052,8 @@ env_aset(VALUE obj, VALUE nm, VALUE val) } if (NIL_P(val)) { - rb_raise(rb_eTypeError, "cannot assign nil; use Hash#delete instead"); + env_delete(obj, nm); + return Qnil; } StringValue(nm); StringValue(val); |