summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-07 15:34:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-07 15:34:31 +0000
commit9481face427a93e1a557ecd980ec82f5d04da8d5 (patch)
tree62cdfef0f5cf342039ea74934348a4de34d77007 /gc.c
parenta4c37a4b7fb14c1eb81cbd3226761c522f3a49bc (diff)
* parse.y (value_expr0): class and module statements should not be
warned for "void value expression". [ruby-talk:72989] * gc.c (add_final): should determine type by respond_to? * gc.c (define_final): ditto. * io.c (rb_io_ctl): should not depend on respond_to? * range.c (range_step): rb_check_string_type(). * process.c (proc_setgroups): new functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index 01f59dac94..a34a3238a2 100644
--- a/gc.c
+++ b/gc.c
@@ -1415,8 +1415,8 @@ add_final(os, block)
VALUE os, block;
{
rb_warn("ObjectSpace::add_finalizer is deprecated; use define_finalizer");
- if (!rb_obj_is_kind_of(block, rb_cBlock)) {
- rb_raise(rb_eArgError, "wrong type argument %s (Block required)",
+ if (!rb_respond_to(block, rb_intern("call"))) {
+ rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
rb_obj_classname(block));
}
rb_ary_push(finalizers, block);
@@ -1471,8 +1471,8 @@ define_final(argc, argv, os)
if (argc == 1) {
block = rb_block_new();
}
- else if (!rb_obj_is_kind_of(block, rb_cBlock)) {
- rb_raise(rb_eArgError, "wrong type argument %s (Block required)",
+ else if (!rb_respond_to(block, rb_intern("call"))) {
+ rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
rb_obj_classname(block));
}
need_call_final = 1;