diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-26 15:58:31 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-26 15:58:31 +0900 |
| commit | ee7f2c8cf71a39cae80a5388f27f578344b7f592 (patch) | |
| tree | da408cb6a20a9bec42f82b679a82338a9c37b03f /src/error.c | |
| parent | e62f874bda195d328531da788bb408b84293fbb6 (diff) | |
| parent | 7007ce7ce0aa4b18fac346bcbf5f9f73c50039ea (diff) | |
| download | mruby-ee7f2c8cf71a39cae80a5388f27f578344b7f592.tar.gz mruby-ee7f2c8cf71a39cae80a5388f27f578344b7f592.zip | |
Merge branch 'get-backtrace' of https://github.com/wanabe/mruby into wanabe-get-backtrace
Diffstat (limited to 'src/error.c')
| -rw-r--r-- | src/error.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c index 98b49ad82..03f587a38 100644 --- a/src/error.c +++ b/src/error.c @@ -435,6 +435,8 @@ mrb_sys_fail(mrb_state *mrb, const char *mesg) } } +mrb_value mrb_get_backtrace(mrb_state*, mrb_value); + void mrb_init_exception(mrb_state *mrb) { @@ -448,6 +450,7 @@ mrb_init_exception(mrb_state *mrb) mrb_define_method(mrb, e, "to_s", exc_to_s, MRB_ARGS_NONE()); mrb_define_method(mrb, e, "message", exc_message, MRB_ARGS_NONE()); mrb_define_method(mrb, e, "inspect", exc_inspect, MRB_ARGS_NONE()); + mrb_define_method(mrb, e, "backtrace", mrb_get_backtrace, MRB_ARGS_NONE()); 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 */ |
