Skip to content

Commit bafc36a

Browse files
committedJan 4, 2014
Fix Enumerable#each_slice yielding
1 parent aab1c34 commit bafc36a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎opal/corelib/enumerable.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def each_slice(n, &block)
318318
slice.push(param);
319319
320320
if (slice.length === n) {
321-
if (block(slice) === $breaker) {
321+
if ($opal.$yield1(block, slice) === $breaker) {
322322
result = $breaker.$v;
323323
return $breaker;
324324
}
@@ -335,7 +335,7 @@ def each_slice(n, &block)
335335
336336
// our "last" group, if smaller than n then won't have been yielded
337337
if (slice.length > 0) {
338-
if (block(slice) === $breaker) {
338+
if ($opal.$yield1(block, slice) === $breaker) {
339339
return $breaker.$v;
340340
}
341341
}

0 commit comments

Comments
 (0)
Please sign in to comment.