From 69d99b010b739ec48a53ee2f9979ec91b0480931 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Apr 2006 03:02:03 +0000 Subject: * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1. [ruby-dev:28585] * parse.y (list_concat): revert last change. * parse.y (arg): use NODE_ARGSCAT for placeholder. * lib/getoptlong.rb (GetoptLong::get): RDoc update patch from mathew . [ruby-core:07738] * variable.c (rb_const_set): raise error when no target klass is supplied. [ruby-dev:28582] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 72ef979a9..0ca978d4b 100644 --- a/variable.c +++ b/variable.c @@ -1670,6 +1670,10 @@ rb_const_set(klass, id, val) ID id; VALUE val; { + if (NIL_P(klass)) { + rb_raise(rb_eTypeError, "no class/module to define constant %s", + rb_id2name(id)); + } mod_av_set(klass, id, val, Qtrue); } -- cgit