diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | hash.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Sep 23 08:25:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * hash.c (env_aset): allow nil value to remove an entry. + [ruby-dev:36465] + Tue Sep 23 08:07:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * misc/ruby-mode.el (ruby-keyword-end-re): emacs21 support. a @@ -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); |