mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
the argument for Exception.new is optinal
This commit is contained in:
+3
-3
@@ -56,9 +56,9 @@ exc_initialize(mrb_state *mrb, mrb_value exc)
|
||||
{
|
||||
mrb_value mesg;
|
||||
|
||||
mrb_get_args(mrb, "o", &mesg);
|
||||
mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), mesg);
|
||||
|
||||
if (mrb_get_args(mrb, "|o", &mesg) == 1) {
|
||||
mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), mesg);
|
||||
}
|
||||
return exc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user