diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-02-03 05:34:16 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-02-03 05:34:16 +0000 |
commit | 0c90036fd14fd5aef136afccfb38e42c4d3c01e3 (patch) | |
tree | b7b065aabe639d272c8e53defbe59daac51bbf23 /eval.c | |
parent | e58e5cb5caf8aeac402ebe2db617c20beca2c0eb (diff) |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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)); } |