Skip to content

Commit

Permalink
Quick fix for Enumerable#collect
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Sep 24, 2013
1 parent d7a39ef commit 871fdda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion corelib/enumerable.rb
Expand Up @@ -86,7 +86,11 @@ def collect(&block)
var proc = function() {
var value, args = $slice.call(arguments);
if ((value = block.apply(null, arguments)) === $breaker) {
if (block.length > 1 && args.length === 1 && args[0]._isArray) {
args = args[0]
}
if ((value = block.apply(null, args)) === $breaker) {
return $breaker.$v;
}
Expand Down

0 comments on commit 871fdda

Please sign in to comment.