From bc75cb8b4325c5f86893e58542ded2f5380a6b4a Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 1 Jul 2003 01:36:25 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@4019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'class.c') diff --git a/class.c b/class.c index 0fce4bcfc..409d5d695 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; } -- cgit