diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:15:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:15:34 +0000 |
commit | 65fed5dad3dbcbb60cc6ccffd4e43359ec29ffb4 (patch) | |
tree | 89d4722df33c2ec8e115078fa88cdc286842e454 /class.c | |
parent | 88695fc0ea105d16f3c40be0119c18ff7306331b (diff) | |
download | ruby-65fed5dad3dbcbb60cc6ccffd4e43359ec29ffb4.tar.gz |
* class.c (rb_mod_init_copy): always copy singleton class.
[ruby-dev:22325]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -63,6 +63,9 @@ rb_mod_init_copy(clone, orig) VALUE clone, orig; { rb_obj_init_copy(clone, orig); + if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) { + RBASIC(clone)->klass = rb_singleton_class_clone(orig); + } RCLASS(clone)->super = RCLASS(orig)->super; if (RCLASS(orig)->iv_tbl) { ID id; |