summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-19 03:02:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-19 03:02:03 +0000
commit1d3fd0024d2e8821e863a39c53c38dfea65b6fa6 (patch)
treef21bece08a142f30fbda7c02cc7358657e22e0f5 /variable.c
parent763420cbcf964a50e16e2239ea55e80cb778ffae (diff)
* 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 <meta at pobox.com>. [ruby-core:07738] * variable.c (rb_const_set): raise error when no target klass is supplied. [ruby-dev:28582] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index 72ef979a9f..0ca978d4b0 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);
}