summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 14:32:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-13 14:32:40 +0000
commit3738ebe15aaedcf4cf38021ade61909c84707b93 (patch)
treefffeaa010b03cfc4213afa938edf3eb882f93ae6
parenta4629a2ec5c0d975947fb7b18e67776639974e66 (diff)
* object.c (Init_Object): no needs to override with same method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog1
-rw-r--r--class.c2
-rw-r--r--object.c1
3 files changed, 2 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c6c78846c4..211075705b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ Thu Dec 13 23:14:17 2012 Shugo Maeda <shugo@ruby-lang.org>
See [ruby-core:50871] for details.
Thu Dec 13 23:10:52 Charlie Somerville <charlie@charliesomerville.com>
+
* object.c (Init_Object): use rb_mod_init_copy for Class#initialize_copy
* class.c (rb_class_init_copy): rename to class_init_copy_check, performs type
checks on arguments to prevent reinitialization of initialized class
diff --git a/class.c b/class.c
index badcb3a5f0..43862d6d4d 100644
--- a/class.c
+++ b/class.c
@@ -177,7 +177,7 @@ class_init_copy_check(VALUE clone, VALUE orig)
VALUE
rb_mod_init_copy(VALUE clone, VALUE orig)
{
- if(RB_TYPE_P(clone, T_CLASS)) {
+ if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}
rb_obj_init_copy(clone, orig);
diff --git a/object.c b/object.c
index 30ca301c94..b4e67bab5b 100644
--- a/object.c
+++ b/object.c
@@ -3101,7 +3101,6 @@ Init_Object(void)
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_mod_init_copy, 1); /* in class.c */
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");