make behavior of Fiber without block compatible with CRuby

This commit is contained in:
take_cheeze
2014-03-20 04:49:14 +09:00
parent daaedf320c
commit de65d4e2a7
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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)) {
+4
View File
@@ -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