summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-01 06:03:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-01 06:03:03 +0000
commit9f0d9bd7111ecfbc087cc4dfe6b4d46e8b98800f (patch)
treeec2aadfdc8488f26e27777b91b415c2f2eb0521f /object.c
parent3d51761abd3bbda185410dd980e2e064b848ad02 (diff)
* file.c (rb_stat_inspect): print dev, rdev in hexadecimal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/object.c b/object.c
index e2ecbd3..f455813 100644
--- a/object.c
+++ b/object.c
@@ -115,6 +115,9 @@ rb_obj_dup(obj)
{
VALUE dup;
+ if (rb_special_const_p(obj)) {
+ rb_raise(rb_eTypeError, "can't dup %s", rb_class2name(CLASS_OF(obj)));
+ }
dup = rb_funcall(obj, clone, 0, 0);
if (TYPE(dup) != TYPE(obj)) {
rb_raise(rb_eTypeError, "dupulicated object must be same type");
@@ -1239,8 +1242,6 @@ Init_Object()
rb_define_method(rb_cNilClass, "&", false_and, 1);
rb_define_method(rb_cNilClass, "|", false_or, 1);
rb_define_method(rb_cNilClass, "^", false_xor, 1);
- rb_undef_method(rb_cNilClass, "clone");
- rb_undef_method(rb_cNilClass, "dup");
rb_define_method(rb_cNilClass, "nil?", rb_true, 0);
rb_undef_method(CLASS_OF(rb_cNilClass), "allocate");
@@ -1316,8 +1317,6 @@ Init_Object()
rb_define_method(rb_cTrueClass, "^", true_xor, 1);
rb_undef_method(CLASS_OF(rb_cTrueClass), "allocate");
rb_undef_method(CLASS_OF(rb_cTrueClass), "new");
- rb_undef_method(rb_cTrueClass, "clone");
- rb_undef_method(rb_cTrueClass, "dup");
rb_define_global_const("TRUE", Qtrue);
rb_cFalseClass = rb_define_class("FalseClass", rb_cObject);
@@ -1327,8 +1326,6 @@ Init_Object()
rb_define_method(rb_cFalseClass, "^", false_xor, 1);
rb_undef_method(CLASS_OF(rb_cFalseClass), "allocate");
rb_undef_method(CLASS_OF(rb_cFalseClass), "new");
- rb_undef_method(rb_cFalseClass, "clone");
- rb_undef_method(rb_cFalseClass, "dup");
rb_define_global_const("FALSE", Qfalse);
eq = rb_intern("==");