summaryrefslogtreecommitdiffstats
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index b778bfea8..4196802de 100644
--- a/enum.c
+++ b/enum.c
@@ -1451,6 +1451,7 @@ enum_take_while(VALUE obj)
{
VALUE ary;
+ RETURN_ENUMERATOR(obj, 0, 0);
ary = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, take_while_i, (VALUE)&ary);
return ary;
@@ -1522,6 +1523,7 @@ enum_drop_while(VALUE obj)
{
VALUE args[2];
+ RETURN_ENUMERATOR(obj, 0, 0);
args[0] = rb_ary_new();
args[1] = Qfalse;
rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)args);