diff --git a/ChangeLog b/ChangeLog index 32d7321f77..a3149b613b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Oct 5 11:59:13 2001 Nobuyoshi Nakada + + * eval.c (proc_s_new): revived. + + * eval.c (Init_Proc): define Proc.new instead of Proc.allocate to + inhibit from creating uninitialized Proc. + Thu Oct 4 14:11:03 2001 WATANABE Hirofumi * ext/socket/socket.c (ruby_connect): EALREADY is the equivalent diff --git a/eval.c b/eval.c index 8b37fdf20c..d7608bf22b 100644 --- a/eval.c +++ b/eval.c @@ -6364,6 +6364,18 @@ proc_new(klass) return proc; } +static VALUE +proc_s_new(argc, argv, klass) + int argc; + VALUE *argv; + VALUE klass; +{ + VALUE proc = proc_new(klass); + + rb_obj_call_init(proc, argc, argv); + return proc; +} + VALUE rb_f_lambda() { @@ -6969,7 +6981,8 @@ Init_Proc() rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError); rb_cProc = rb_define_class("Proc", rb_cObject); - rb_define_singleton_method(rb_cProc, "allocate", proc_new, 0); + rb_undef_method(CLASS_OF(rb_cProc), "allocate"); + rb_define_singleton_method(rb_cProc, "new", proc_s_new, -1); rb_define_method(rb_cProc, "call", proc_call, -2); rb_define_method(rb_cProc, "yield", proc_yield, -2);