Skip to content

Commit

Permalink
Make Enumerable#entries compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Nov 10, 2013
1 parent 19a2e5a commit c2e533b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions opal/core/enumerable.rb
Expand Up @@ -382,15 +382,15 @@ def each_with_object(object, &block)
object
end

def entries
def entries(*args)
%x{
var result = [];
self.$each._p = function() {
result.push(#{Opal.destructure(`arguments`)});
};
self.$each();
self.$each.apply(self, args);
return result;
}
Expand Down
2 changes: 0 additions & 2 deletions spec/filters/bugs/enumerable.rb
@@ -1,8 +1,6 @@
opal_filter "Enumerable" do
fails "Enumerable#cycle passed a number n as an argument raises an ArgumentError if more arguments are passed"

fails "Enumerable#entries passes arguments to each"

fails "Enumerable#first when passed an argument consumes only what is needed"
fails "Enumerable#first when passed an argument raises a TypeError if the passed argument is not numeric"
fails "Enumerable#first when passed an argument tries to convert the passed argument to an Integer using #to_int"
Expand Down

0 comments on commit c2e533b

Please sign in to comment.