From 4f38c453b4fccfbc529909781c2c1659f256697b Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 28 Jan 2002 08:44:45 +0000 Subject: * eval.c (is_defined): defined?(Foo::Baz) should check constants only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. * object.c (Init_Object): remove dup and clone from TrueClass, FalseClass, and NilClass. * array.c (rb_ary_fill): Array#fill takes block to get the value to fill. * string.c (rb_str_to_i): to_i(0) auto-detects base radix. * array.c (rb_ary_initialize): fill by the block evaluation value if block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index 2c4440c89a..e2ecbd30a7 100644 --- a/object.c +++ b/object.c @@ -1239,6 +1239,8 @@ 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"); @@ -1314,6 +1316,8 @@ 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); @@ -1323,6 +1327,8 @@ 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("=="); -- cgit v1.2.3