From 7b484902220ded077a37a3a2e4587df2fe27f5e0 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 17 Jun 2006 14:50:04 +0000 Subject: * 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 --- hash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hash.c') 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; -- cgit v1.2.3