Skip to content

Commit c2e533b

Browse files
committedNov 10, 2013
Make Enumerable#entries compliant
1 parent 19a2e5a commit c2e533b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed
 

‎opal/core/enumerable.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@ def each_with_object(object, &block)
382382
object
383383
end
384384

385-
def entries
385+
def entries(*args)
386386
%x{
387387
var result = [];
388388
389389
self.$each._p = function() {
390390
result.push(#{Opal.destructure(`arguments`)});
391391
};
392392
393-
self.$each();
393+
self.$each.apply(self, args);
394394
395395
return result;
396396
}

‎spec/filters/bugs/enumerable.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
opal_filter "Enumerable" do
22
fails "Enumerable#cycle passed a number n as an argument raises an ArgumentError if more arguments are passed"
33

4-
fails "Enumerable#entries passes arguments to each"
5-
64
fails "Enumerable#first when passed an argument consumes only what is needed"
75
fails "Enumerable#first when passed an argument raises a TypeError if the passed argument is not numeric"
86
fails "Enumerable#first when passed an argument tries to convert the passed argument to an Integer using #to_int"

0 commit comments

Comments
 (0)
Please sign in to comment.