summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-catch/src
AgeCommit message (Collapse)Author
2021-06-20Added `MRB_OBJ_ALLOC()` macro that does not require a castdearblue
The `MRB_OBJ_ALLOC()` macro function returns a pointer of the type corresponding to the constant literal defined in `enum mrb_vtype`.
2021-04-24Introduce `MRB_GC_RED`dearblue
Replaces the magic number `7` except in `src/gc.c`.
2021-04-04Making a proc object static for a method with static irepdearblue
The following methods will be made static. - `Class#new` - `Proc#call` - `Kernel#catch` Previously, static const RProc could not be registered as a method, but this has been changed to allow it.
2021-02-12Fix build `mruby-catch` gem without presymKOBAYASHI Shuji
2021-02-12Rename `mruby-catch.c` to `catch.c`; ref #5328Yukihiro "Matz" Matsumoto
2021-02-10Refactor `mruby-catch`; ref #5328Yukihiro "Matz" Matsumoto
- Move `#catch` definition to `mruby-catch.c` to avoid tweaking - Remove `#__preserve_catch_method` - Implement whole `#throw` method in C
2021-02-06Reimplement mruby-catch; ref #5321dearblue
When there is a corresponding tag, the `RBreak` object is used to make a global jump. Like CRuby, it can't be caught by `rescue`. It is also the same as CRuby that it can be canceled in the middle by `ensure`. ### How to find the corresponding tag with `throw` The called `catch` method remains in the call stack, and the tag also remains in the stack at that time. So it is possible to find the called location by searching the two. Note that no method can be given to the `proc` object specified in `RBreak`. Therefore, inside the `catch` method, the argument block is called in a seemingly meaningless closure. Also, as a countermeasure against `alias` etc., the `proc` object, which is the body of the `catch` method, is saved when mrbgem is initialized.