summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-03 09:30:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-03 09:30:33 +0000
commit379e85a5f5b243f307b97b76a762947ffbe6bc48 (patch)
treebfbe7e40f4e9e813d4cdce3a5776da1ec41a8080 /object.c
parent744ec6294cbe29513af083bf1106b68247c72275 (diff)
* eval.c (proc_invoke): copy arguments to frame.argv.
[ruby-core:03861] * object.c (convert_type): use rb_respond_to() again. [ruby-dev:25021] * eval.c (rb_respond_to): funcall respond_to? if it's redefined. [ruby-dev:25021] * io.c (rb_file_initialize): [ruby-dev:25032] * lib/ostruct.rb (OpenStruct::Marshaler): OpenStruct can be marshaled again. [ruby-core:03862] * io.c (rb_io_ctl): [ruby-dev:25019] * io.c (io_fread): need not to null terminate. [ruby-dev:24998] * io.c (read_all): remove unnecessary rb_str_resize(). [ruby-dev:24996] * io.c (io_read): ditto. * io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7447 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 1a54739..858ddf3 100644
--- a/object.c
+++ b/object.c
@@ -2036,9 +2036,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" :
@@ -2048,11 +2049,10 @@ convert_type(val, tname, method, raise)
tname);
}
else {
- ruby_errinfo = Qnil;
return Qnil;
}
}
- return result;
+ return rb_funcall(val, m, 0);
}
VALUE