mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use MRB_TT_EXCEPTION in exception object.
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct RException {
|
||||
MRB_OBJECT_HEADER;
|
||||
struct iv_tbl *iv;
|
||||
};
|
||||
|
||||
#define mrb_exc_ptr(v) ((struct RException*)mrb_ptr(v))
|
||||
|
||||
void mrb_sys_fail(mrb_state *mrb, const char *mesg);
|
||||
mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str);
|
||||
#define mrb_exc_new_str_lit(mrb, c, lit) mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit))
|
||||
|
||||
@@ -122,6 +122,7 @@ enum mrb_vtype {
|
||||
#define mrb_string_p(o) (mrb_type(o) == MRB_TT_STRING)
|
||||
#define mrb_hash_p(o) (mrb_type(o) == MRB_TT_HASH)
|
||||
#define mrb_cptr_p(o) (mrb_type(o) == MRB_TT_CPTR)
|
||||
#define mrb_exception_p(o) (mrb_type(o) == MRB_TT_EXCEPTION)
|
||||
#define mrb_test(o) mrb_bool(o)
|
||||
mrb_bool mrb_regexp_p(struct mrb_state*, mrb_value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user