summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-01 01:36:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-01 01:36:25 +0000
commit442c836bfe7396f81a0f1f2f8daeeeabbf0d0343 (patch)
treef5366b3fb371e3a294c4d3dc6559e7bc772c4f94 /class.c
parent7bb1e40d8b5928a7d3740b72f02f6a5d5fb0d21b (diff)
* class.c (rb_define_class, rb_define_module): also set constant under
Object. [ruby-dev:20445] * object.c (boot_defclass): ditto. * variable.c (rb_const_get_at, rb_const_get_0, rb_mod_const_at, rb_const_defined, mod_av_set, rb_const_assign): toplevel constants are now under Object, rb_class_tbl remains for GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class.c b/class.c
index 0fce4bc..409d5d6 100644
--- a/class.c
+++ b/class.c
@@ -213,6 +213,7 @@ rb_define_class(name, super)
}
klass = rb_define_class_id(id, super);
st_add_direct(rb_class_tbl, id, klass);
+ rb_const_set(rb_cObject, id, klass);
rb_class_inherited(super, klass);
return klass;
@@ -292,6 +293,7 @@ rb_define_module(name)
}
module = rb_define_module_id(id);
st_add_direct(rb_class_tbl, id, module);
+ rb_const_set(rb_cObject, id, module);
return module;
}