diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-05 15:55:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-05 15:55:09 +0000 |
commit | ce44928d2b4d32b41f9a19097fb7bd7b2c13c4bd (patch) | |
tree | e2e9c28e8caf5535b343988de6fa23ed0f941695 /error.c | |
parent | cded3d5c93f0964fc504a4344146e3624a9875a1 (diff) | |
download | ruby-ce44928d2b4d32b41f9a19097fb7bd7b2c13c4bd.tar.gz |
* error.c (Init_Exception): remove Exception#to_str. [Ruby2]
* eval.c (error_print): should no call "to_str" anymore use
"message" method instead.
* io.c (rb_f_open): Kernel#open() calls "to_open" if the first
argument responds to it. [Ruby2]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -405,7 +405,6 @@ exc_to_s(exc) /* * call-seq: * exception.message => string - * exception.to_str => string * * Returns the result of invoking <code>exception.to_s</code>. * Normally this returns the exception's message or name. By @@ -414,7 +413,7 @@ exc_to_s(exc) */ static VALUE -exc_to_str(exc) +exc_message(exc) VALUE exc; { return rb_funcall(exc, rb_intern("to_s"), 0, 0); @@ -962,8 +961,7 @@ Init_Exception() rb_define_method(rb_eException, "exception", exc_exception, -1); rb_define_method(rb_eException, "initialize", exc_initialize, -1); rb_define_method(rb_eException, "to_s", exc_to_s, 0); - rb_define_method(rb_eException, "to_str", exc_to_str, 0); - rb_define_method(rb_eException, "message", exc_to_str, 0); + rb_define_method(rb_eException, "message", exc_message, 0); rb_define_method(rb_eException, "inspect", exc_inspect, 0); rb_define_method(rb_eException, "backtrace", exc_backtrace, 0); rb_define_method(rb_eException, "set_backtrace", exc_set_backtrace, 1); |