зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
88695fc0ea
Коммит
65fed5dad3
|
@ -1,8 +1,13 @@
|
|||
Mon Dec 22 21:15:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* class.c (rb_mod_init_copy): always copy singleton class.
|
||||
[ruby-dev:22325]
|
||||
|
||||
Mon Dec 22 20:44:36 2003 akira yamada <akira@ruby-lang.org>
|
||||
|
||||
* lib/uri/generic.rb (URI::Generic#route_from): accepts urls which
|
||||
has no host-part.
|
||||
|
||||
|
||||
* test/uri/test_generic.rb (TestGeneric::test_route): added a test.
|
||||
|
||||
Mon Dec 22 20:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
|
3
class.c
3
class.c
|
@ -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;
|
||||
|
|
1
object.c
1
object.c
|
@ -1662,6 +1662,7 @@ Init_Object()
|
|||
rb_define_method(rb_cClass, "allocate", rb_obj_alloc, 0);
|
||||
rb_define_method(rb_cClass, "new", rb_class_new_instance, -1);
|
||||
rb_define_method(rb_cClass, "initialize", rb_class_initialize, -1);
|
||||
rb_define_method(rb_cClass, "initialize_copy", rb_class_init_copy, 1);
|
||||
rb_define_method(rb_cClass, "superclass", rb_class_superclass, 0);
|
||||
rb_define_alloc_func(rb_cClass, rb_class_s_alloc);
|
||||
rb_undef_method(rb_cClass, "extend_object");
|
||||
|
|
Загрузка…
Ссылка в новой задаче