summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-03 04:56:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-03 04:56:25 +0000
commit405a50a5948fecb6ba44efb250a86052f4a406c8 (patch)
treedf3be019a29fca68dc14bd106d074d8f18c21875 /object.c
parentda4884e2d4ea78b39cfdea0a747f2b700ccedfbc (diff)
* eval.c (proc_invoke): prepare to pass a block from "call" method
to a Proc generated by Method#to_proc. [ruby-dev:25031] * eval.c (rb_yield_0): actually passes a block given to "call". * object.c (convert_type): use rb_respond_to() again. this fix is based on [ruby-dev:25021] * eval.c (rb_respond_to): funcall respond_to? if it's redefined. [ruby-dev:25021] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/object.c b/object.c
index a196e3bf82..3d77c36a1b 100644
--- a/object.c
+++ b/object.c
@@ -2056,9 +2056,10 @@ convert_type(val, tname, method, raise)
const char *tname, *method;
int raise;
{
- VALUE result = rb_funcall_rescue(val, rb_intern(method), 0);
+ ID m;
- if (result == Qundef) {
+ m = rb_intern(method);
+ if (!rb_respond_to(val, m)) {
if (raise) {
rb_raise(rb_eTypeError, "cannot convert %s into %s",
NIL_P(val) ? "nil" :
@@ -2068,11 +2069,10 @@ convert_type(val, tname, method, raise)
tname);
}
else {
- ruby_errinfo = Qnil;
return Qnil;
}
}
- return result;
+ return rb_funcall(val, m, 0);
}
VALUE