aboutsummaryrefslogtreecommitdiffstats
path: root/enumerator.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-18 12:59:01 -0700
committerJeremy Evans <code@jeremyevans.net>2019-09-20 07:45:18 -0700
commitc9f2b790adcff8df48e3192d18ee8afa02f5530c (patch)
tree76cd3f6cd1de86b9d6d947f0a2237615074d7bc9 /enumerator.c
parent27b67468724dc48ed8305d8cb33484a4af98fc05 (diff)
downloadruby-c9f2b790adcff8df48e3192d18ee8afa02f5530c.tar.gz
Handle keyword argument separation for Enumerator#size
When Object#to_enum is passed a block, the block is called to get a size with the arguments given to to_enum. This calls the block with the same keyword flag as to_enum is called with. This requires adding rb_check_funcall_kw and rb_check_funcall_default_kw to handle keyword flags.
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index 2a94aa388f..af9dc0fd2b 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -1223,7 +1223,7 @@ enumerator_size(VALUE obj)
argc = (int)RARRAY_LEN(e->args);
argv = RARRAY_CONST_PTR(e->args);
}
- size = rb_check_funcall(e->size, id_call, argc, argv);
+ size = rb_check_funcall_kw(e->size, id_call, argc, argv, e->kw_splat);
if (size != Qundef) return size;
return e->size;
}