-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement mrb_protect
.
#2845
Implement mrb_protect
.
#2845
Conversation
…ptions`. (`mrb_rescue_exceptions` is mruby implementation of `rb_rescue2`.) Closes mruby#2844, closes mruby#2837.
@take-cheeze ++ |
Great! But I see one issue. Your test code even contains it: return mrb_rescue_exceptions(mrb, protect_cb, b, protect_cb, r, E_TYPE_ERROR, NULL);
|
Hurray! Regarding @cremno's comment, +1 for the array argument idea. It could still be NULL terminated, without sacrificing type safety (or go the length + array route... either way). Thanks, @take-cheeze! |
@cremno MRB_API mrb_value mrb_rescue_exceptions(
mrb_state *mrb, mrb_func_t body, mrb_value b_data,
mrb_func_t rescue, mrb_value r_data,
mrb_int classes_len, struct RClasss **classes); |
Done changing to array of classes API. ( 15c869f ) |
yay |
merged |
This pull request implements
mrb_protect
,mrb_ensure
,mrb_rescue
,mrb_rescue_exceptions
.(
mrb_rescue_exceptions
is implementation ofrb_rescue2
.)The 4 APIs are placed to "mruby-error" mrbgem which is included to 'default' gembox for now.
The changes to
Build#compile_as_cxx
is for missing directory when generating C++ file in some cases.