summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-29 00:05:45 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-29 00:05:45 (GMT)
commite42f4ae77363e0b85587e67fb86603123bfbd3cb (patch)
tree886607e57aef09ede4ffa504b1367cd0bb1bc7de /array.c
parentc1718e988e24de48bf8ebe8d2421b4531dbe7b58 (diff)
array.c: yield blockarg in collect
* array.c (rb_ary_collect): yield in block argument semantics always to splat array elements to lambda, for the backward compatibility. [ruby-core:86362] [Bug #14639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 1d53628..dbcc09d 100644
--- a/array.c
+++ b/array.c
@@ -2738,7 +2738,7 @@ rb_ary_collect(VALUE ary)
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
collect = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_push(collect, rb_yield(RARRAY_AREF(ary, i)));
+ rb_ary_push(collect, rb_yield_force_blockarg(RARRAY_AREF(ary, i)));
}
return collect;
}