mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-proc-ext/proc.c (mrb_proc_parameters): skip empty block slot.
Unlike other formal arguments, a block argument has an empty slot even when the block is not given.
This commit is contained in:
@@ -176,6 +176,8 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
|
||||
}
|
||||
mrb_ary_push(mrb, parameters, a);
|
||||
}
|
||||
/* need to skip empty block slot */
|
||||
if (p->size == 0 && p->name == MRB_SYM(block)) i++;
|
||||
}
|
||||
if (!mrb_nil_p(krest)) mrb_ary_push(mrb, parameters, krest);
|
||||
if (!mrb_nil_p(block)) mrb_ary_push(mrb, parameters, block);
|
||||
|
||||
Reference in New Issue
Block a user