Skip to content

Commit

Permalink
Fix Enumerable#each_slice yielding
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jan 4, 2014
1 parent aab1c34 commit bafc36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opal/corelib/enumerable.rb
Expand Up @@ -318,7 +318,7 @@ def each_slice(n, &block)
slice.push(param);
if (slice.length === n) {
if (block(slice) === $breaker) {
if ($opal.$yield1(block, slice) === $breaker) {
result = $breaker.$v;
return $breaker;
}
Expand All @@ -335,7 +335,7 @@ def each_slice(n, &block)
// our "last" group, if smaller than n then won't have been yielded
if (slice.length > 0) {
if (block(slice) === $breaker) {
if ($opal.$yield1(block, slice) === $breaker) {
return $breaker.$v;
}
}
Expand Down

0 comments on commit bafc36a

Please sign in to comment.