aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--hash.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 310e47dace..5eb77c9870 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/hash.c b/hash.c
index 694b619529..bc627d868f 100644
--- a/hash.c
+++ b/hash.c
@@ -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);