mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
make behavior of Fiber without block compatible with CRuby
This commit is contained in:
@@ -73,7 +73,7 @@ fiber_init(mrb_state *mrb, mrb_value self)
|
||||
mrb_get_args(mrb, "&", &blk);
|
||||
|
||||
if (mrb_nil_p(blk)) {
|
||||
mrb_raise(mrb, E_FIBER_ERROR, "tried to create Fiber object without a block");
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Fiber object without a block");
|
||||
}
|
||||
p = mrb_proc_ptr(blk);
|
||||
if (MRB_PROC_CFUNC_P(p)) {
|
||||
|
||||
@@ -110,3 +110,7 @@ assert('Root fiber resume') do
|
||||
f.resume
|
||||
assert_false f.alive?
|
||||
end
|
||||
|
||||
assert('Fiber without block') do
|
||||
assert_raise(ArgumentError) { Fiber.new }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user