From e25e3851e39e64c39d9f9e2c69d03d9e6973c88e Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 3 Feb 2003 05:34:16 +0000 Subject: * re.c (rb_memsearch): algolithm body of String#index. * error.c (Init_Exception): "to_str" removed. * eval.c (eval): should not rely on Exception#to_str * eval.c (compile_error): ditto. * error.c (err_append): ditto. * hash.c (rb_hash_merge): Hash#merge, non destructive "update". now there's also Hash#merge! which is an alias to "update". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index aedcefcf7..dc26c1c4a 100644 --- a/eval.c +++ b/eval.c @@ -1351,7 +1351,7 @@ compile_error(at) } rb_str_buf_cat(str, "\n", 1); if (!NIL_P(ruby_errinfo)) { - rb_str_append(str, ruby_errinfo); + rb_str_append(str, rb_obj_as_string(ruby_errinfo)); } rb_exc_raise(rb_exc_new3(rb_eSyntaxError, str)); } @@ -5176,18 +5176,18 @@ eval(self, src, scope, file, line) ruby_set_current_source(); if (state) { if (state == TAG_RAISE) { - VALUE err; - VALUE errat; + VALUE err, errat, mesg; + mesg = rb_obj_as_string(ruby_errinfo); if (strcmp(file, "(eval)") == 0) { if (ruby_sourceline > 1) { errat = get_backtrace(ruby_errinfo); err = rb_str_dup(RARRAY(errat)->ptr[0]); rb_str_cat2(err, ": "); - rb_str_append(err, ruby_errinfo); + rb_str_append(err, mesg); } else { - err = rb_str_dup(ruby_errinfo); + err = mesg; } rb_exc_raise(rb_funcall(ruby_errinfo, rb_intern("exception"), 1, err)); } -- cgit