diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-20 20:43:27 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-20 20:43:27 +0900 |
| commit | ef50e63a63c9b3759a2030816c9e2c5ec4e14cd0 (patch) | |
| tree | a7d80c195f7421ca6dd3ebd6e1526aae1c18f420 /src | |
| parent | 6f22a61135fd077c1dcff2dec92ab215e3a83d79 (diff) | |
| download | mruby-ef50e63a63c9b3759a2030816c9e2c5ec4e14cd0.tar.gz mruby-ef50e63a63c9b3759a2030816c9e2c5ec4e14cd0.zip | |
remove RuntimeError from mrb_state
Diffstat (limited to 'src')
| -rw-r--r-- | src/error.c | 8 | ||||
| -rw-r--r-- | src/gc.c | 2 | ||||
| -rw-r--r-- | src/kernel.c | 6 | ||||
| -rw-r--r-- | src/re.c | 2 | ||||
| -rw-r--r-- | src/string.c | 2 | ||||
| -rw-r--r-- | src/vm.c | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/src/error.c b/src/error.c index b2d9a8c8d..1183d8643 100644 --- a/src/error.c +++ b/src/error.c @@ -301,7 +301,7 @@ make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr) if (isstr) { mesg = mrb_check_string_type(mrb, argv[0]); if (!mrb_nil_p(mesg)) { - mesg = mrb_exc_new3(mrb, mrb->eRuntimeError_class, mesg); + mesg = mrb_exc_new3(mrb, E_RUNTIME_ERROR, mesg); break; } } @@ -352,7 +352,7 @@ mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv) void mrb_sys_fail(mrb_state *mrb, const char *mesg) { - mrb_raise(mrb, mrb->eRuntimeError_class, "%s", mesg); + mrb_raise(mrb, E_RUNTIME_ERROR, "%s", mesg); } void @@ -369,6 +369,6 @@ mrb_init_exception(mrb_state *mrb) mrb_define_method(mrb, e, "message", exc_message, ARGS_NONE()); mrb_define_method(mrb, e, "inspect", exc_inspect, ARGS_NONE()); - mrb->eStandardError_class = mrb_define_class(mrb, "StandardError", mrb->eException_class); /* 15.2.23 */ - mrb->eRuntimeError_class = mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */ + mrb->eStandardError_class = mrb_define_class(mrb, "StandardError", mrb->eException_class); /* 15.2.23 */ + mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */ } @@ -277,7 +277,7 @@ gc_protect(mrb_state *mrb, struct RBasic *p) if (mrb->arena_idx > MRB_ARENA_SIZE) { /* arena overflow error */ mrb->arena_idx = MRB_ARENA_SIZE - 4; /* force room in arena */ - mrb_raise(mrb, mrb->eRuntimeError_class, "arena overflow error"); + mrb_raise(mrb, E_RUNTIME_ERROR, "arena overflow error"); } mrb->arena[mrb->arena_idx++] = p; } diff --git a/src/kernel.c b/src/kernel.c index 5b65714b6..209eaa91d 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -573,7 +573,7 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self) mrb_value a, b; if (mrb_get_args(mrb, "|S&", &a, &b) == 1) { - mrb_raise(mrb, mrb->eRuntimeError_class, "instance_eval with string not implemented"); + mrb_raise(mrb, E_RUNTIME_ERROR, "instance_eval with string not implemented"); } return mrb_yield_with_self(mrb, b, 0, 0, self); } @@ -1019,13 +1019,13 @@ mrb_f_raise(mrb_state *mrb, mrb_value self) argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]); switch (argc) { case 0: - mrb_raise(mrb, mrb->eRuntimeError_class, ""); + mrb_raise(mrb, E_RUNTIME_ERROR, ""); break; case 1: a[1] = mrb_check_string_type(mrb, a[0]); if (!mrb_nil_p(a[1])) { argc = 2; - a[0] = mrb_obj_value(mrb->eRuntimeError_class); + a[0] = mrb_obj_value(E_RUNTIME_ERROR); } /* fall through */ default: @@ -2143,7 +2143,7 @@ mrb_reg_regsub(mrb_state *mrb, mrb_value str, mrb_value src, struct re_registers break; } else { - mrb_raise(mrb, mrb->eRuntimeError_class, "invalid group name reference format"); + mrb_raise(mrb, E_RUNTIME_ERROR, "invalid group name reference format"); } } diff --git a/src/string.c b/src/string.c index 6392b504c..585edf8a3 100644 --- a/src/string.c +++ b/src/string.c @@ -100,7 +100,7 @@ str_mod_check(mrb_state *mrb, mrb_value str, char *p, mrb_int len) struct RString *s = mrb_str_ptr(str); if (s->ptr != p || s->len != len) { - mrb_raise(mrb, mrb->eRuntimeError_class, "string modified"); + mrb_raise(mrb, E_RUNTIME_ERROR, "string modified"); } } @@ -1604,7 +1604,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) CASE(OP_ERR) { /* Bx raise RuntimeError with message Lit(Bx) */ mrb_value msg = pool[GETARG_Bx(i)]; - mrb_value exc = mrb_exc_new3(mrb, mrb->eRuntimeError_class, msg); + mrb_value exc = mrb_exc_new3(mrb, E_RUNTIME_ERROR, msg); mrb->exc = (struct RObject*)mrb_object(exc); goto L_RAISE; |
