зеркало из https://github.com/github/ruby.git
error.c: predefined IDs
* error.c (id_bt, id_bt_locations): use IDs predefined in id.h. * vm_args.c (raise_argument_error): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4f3217e326
Коммит
31929bab1f
6
error.c
6
error.c
|
@ -645,8 +645,10 @@ VALUE rb_eSystemCallError;
|
|||
VALUE rb_mErrno;
|
||||
static VALUE rb_eNOERROR;
|
||||
|
||||
static ID id_new, id_bt, id_bt_locations, id_cause, id_message, id_backtrace;
|
||||
static ID id_new, id_cause, id_message, id_backtrace;
|
||||
static ID id_status, id_name, id_args, id_Errno, id_errno, id_i_path;
|
||||
#define id_bt idBt
|
||||
#define id_bt_locations idBt_locations
|
||||
#define id_mesg idMesg
|
||||
|
||||
#undef rb_exc_new_cstr
|
||||
|
@ -1908,8 +1910,6 @@ Init_Exception(void)
|
|||
rb_define_global_function("warn", rb_warn_m, -1);
|
||||
|
||||
id_new = rb_intern_const("new");
|
||||
id_bt = rb_intern_const("bt");
|
||||
id_bt_locations = rb_intern_const("bt_locations");
|
||||
id_cause = rb_intern_const("cause");
|
||||
id_message = rb_intern_const("message");
|
||||
id_backtrace = rb_intern_const("backtrace");
|
||||
|
|
|
@ -682,7 +682,7 @@ raise_argument_error(rb_thread_t *th, const rb_iseq_t *iseq, const VALUE exc)
|
|||
at = rb_vm_backtrace_object();
|
||||
}
|
||||
|
||||
rb_iv_set(exc, "bt_locations", at);
|
||||
rb_ivar_set(exc, idBt_locations, at);
|
||||
rb_funcall(exc, rb_intern("set_backtrace"), 1, at);
|
||||
rb_exc_raise(exc);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче