зеркало из https://github.com/github/ruby.git
eval_error.c: use checking functions
* eval_error.c (error_print): use checking functions instead of catching exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b82ded24cc
Коммит
09de2b0544
|
@ -1,4 +1,7 @@
|
||||||
Mon Jun 10 15:35:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jun 10 15:36:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval_error.c (error_print): use checking functions instead of
|
||||||
|
catching exceptions.
|
||||||
|
|
||||||
* eval_error.c (error_print): restore errinfo for the case new
|
* eval_error.c (error_print): restore errinfo for the case new
|
||||||
excecption raised while printing the message. [ruby-core:55365]
|
excecption raised while printing the message. [ruby-core:55365]
|
||||||
|
|
|
@ -127,9 +127,9 @@ error_print(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
eclass = CLASS_OF(errinfo);
|
eclass = CLASS_OF(errinfo);
|
||||||
if (eclass != Qundef) {
|
if (eclass != Qundef &&
|
||||||
e = rb_funcall(errinfo, rb_intern("message"), 0, 0);
|
(e = rb_check_funcall(errinfo, rb_intern("message"), 0, 0)) != Qundef &&
|
||||||
StringValue(e);
|
(RB_TYPE_P(e, T_STRING) || !NIL_P(e = rb_check_string_type(e)))) {
|
||||||
einfo = RSTRING_PTR(e);
|
einfo = RSTRING_PTR(e);
|
||||||
elen = RSTRING_LEN(e);
|
elen = RSTRING_LEN(e);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче