Skip to content

Commit

Permalink
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/hash/reject_tags.txt

This file was deleted.

18 changes: 14 additions & 4 deletions truffle/src/main/ruby/core/hash.rb
Original file line number Diff line number Diff line change
@@ -44,10 +44,6 @@ def each_item
nil
end

def merge_fallback(other, &block)
merge(Rubinius::Type.coerce_to other, Hash, :to_hash, &block)
end

def find_item(key)
value = _get_or_undefined(key)
if undefined.equal?(value)
@@ -58,4 +54,18 @@ def find_item(key)
end
end

def merge_fallback(other, &block)
merge(Rubinius::Type.coerce_to other, Hash, :to_hash, &block)
end

# Rubinius' Hash#reject taints but we don't want this

def reject(&block)
return to_enum(:reject) unless block_given?
copy = dup
copy.untaint
copy.delete_if(&block)
copy
end

end

0 comments on commit f6bff6e

Please sign in to comment.