summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-17 14:50:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-17 14:50:04 +0000
commit7b484902220ded077a37a3a2e4587df2fe27f5e0 (patch)
treea6fe22dc74558d7a677ca7773b249a2531e3e960 /hash.c
parent7d274ff6fbb97c3ac8ee0ce6903f0e77b05e0b07 (diff)
* eval.c (Init_eval): add aliases invoke_method and
invoke_functional_method corresponding send and funcall respectively. [ruby-talk:197512] * parse.y (parser_yylex): returns the most typical keyword token on EXPR_FNAME. [ruby-core:7995] * ext/socket/socket.c: protoize. * parse.y (then): remove ':' from 'then' and 'do' rules. * hash.c (env_aset): raise TypeError on nil with more descriptive message. [ruby-core:07990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 8ffcfdf3ff..b945042983 100644
--- a/hash.c
+++ b/hash.c
@@ -1759,6 +1759,9 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
rb_raise(rb_eSecurityError, "can't change environment variable");
}
+ if (NIL_P(val)) {
+ rb_raise(rb_eTypeError, "cannot assign nil; use Hash#delete instead");
+ }
StringValue(nm);
StringValue(val);
name = RSTRING(nm)->ptr;