Skip to content

Commit

Permalink
[Truffle] Update Hash#to_proc
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Sep 23, 2016
1 parent e022b49 commit 567e3e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/hash/to_proc_tags.txt

This file was deleted.

6 changes: 5 additions & 1 deletion truffle/src/main/ruby/core/hash.rb
Expand Up @@ -467,7 +467,11 @@ def to_hash
end

def to_proc
lambda { |key| self[key] }
proc_hash = self
Proc.new { |*args|
Rubinius::Type.check_arity(args.size, 1, 1)
proc_hash[args[0]]
}
end

# Implementation of a fundamental Rubinius method that allows their Hash
Expand Down

0 comments on commit 567e3e1

Please sign in to comment.