From 7c6ba274de3deab3dd03fc356b863a69b1828d26 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 8 Apr 2003 05:40:29 +0000 Subject: * eval.c (Init_Proc): make Method and UnboundMethod independent. They are like instance and its class. [ruby-core:00941] * parse.y (yylex): disallow global variables like "$1ve". [ruby-core:00945] * marshal.c (marshal_dump): Marshal.dump(0, false) should cause an error. (ruby-bugs-ja PR#421) * regex.c (re_compile_pattern): warn if '-' is the edge of character range. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 9b4420d7a..5ffcdb04c 100644 --- a/eval.c +++ b/eval.c @@ -7452,10 +7452,16 @@ Init_Proc() rb_define_method(rb_cMethod, "unbind", method_unbind, 0); rb_define_method(rb_mKernel, "method", rb_obj_method, 1); - rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cMethod); + rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cObject); + rb_undef_alloc_func(rb_cUnboundMethod); + rb_undef_method(CLASS_OF(rb_cUnboundMethod), "new"); + rb_define_method(rb_cUnboundMethod, "==", method_eq, 1); + rb_define_method(rb_cUnboundMethod, "clone", method_clone, 0); + rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0); + rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0); + rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0); rb_define_method(rb_cUnboundMethod, "to_proc", umethod_proc, 0); rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1); - rb_define_method(rb_cUnboundMethod, "unbind", umethod_unbind, 0); rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1); } -- cgit