summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-18 05:56:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-18 05:56:05 +0000
commitf35971afdfd05304d0b5d2b0e3042a0c739f877f (patch)
tree7b2ec9bc16cac781813584423a00482fc94869aa /object.c
parentc068201c50bea13d3d48ab7460cdc407946af0ba (diff)
* regex.c (NUM_FAILURE_ITEMS): was confusing NUM_REG_ITEMS and
NUM_NONREG_ITEMS, which have happened to be same value. * class.c (rb_class_new): subclass check moved to this function. * class.c (rb_class_boot): check less version of rb_class_new(). * eval.c (proc_invoke): should preserve iter status for embedded frame in the block. * file.c (rb_file_s_expand_path): may overrun buffer on stack. * string.c (rb_str_insert): forgot to call rb_str_modify(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/object.c b/object.c
index e34bb23b1b..66d369e1e9 100644
--- a/object.c
+++ b/object.c
@@ -655,10 +655,6 @@ rb_class_s_new(argc, argv)
if (rb_scan_args(argc, argv, "01", &super) == 0) {
super = rb_cObject;
}
- Check_Type(super, T_CLASS);
- if (FL_TEST(super, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't make subclass of virtual class");
- }
klass = rb_class_new(super);
/* make metaclass */
RBASIC(klass)->klass = rb_singleton_class_new(RBASIC(super)->klass);
@@ -670,13 +666,6 @@ rb_class_s_new(argc, argv)
}
static VALUE
-rb_class_s_inherited()
-{
- rb_raise(rb_eTypeError, "can't make subclass of Class");
- return Qnil; /* dummy */
-}
-
-static VALUE
rb_class_superclass(klass)
VALUE klass;
{
@@ -1096,7 +1085,7 @@ boot_defclass(name, super)
VALUE super;
{
extern st_table *rb_class_tbl;
- VALUE obj = rb_class_new(super);
+ VALUE obj = rb_class_boot(super);
ID id = rb_intern(name);
rb_name_class(obj, id);
@@ -1271,7 +1260,6 @@ Init_Object()
rb_define_singleton_method(rb_cClass, "new", rb_class_s_new, -1);
rb_undef_method(rb_cClass, "extend_object");
rb_undef_method(rb_cClass, "append_features");
- rb_define_singleton_method(rb_cClass, "inherited", rb_class_s_inherited, 1);
rb_cData = rb_define_class("Data", rb_cObject);
rb_undef_method(CLASS_OF(rb_cData), "new");