Permalink
Browse files

Fix issue when curried proc is passed as block to instance_exec.

  • Loading branch information...
1 parent d692690 commit 67566e51847fe1854f864c6f1548844b1ae04eb3 @headius headius committed Oct 23, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 kernel/common/proc19.rb
View
@@ -24,12 +24,14 @@ def curry(curried_arity = nil)
args = []
+ my_self = self
m = lambda? ? :lambda : :proc
- f = send(m) {|*x|
- args += x
- if args.length >= arity
- self[*args]
+ f = __send__(m) {|*x|
+ call_args = args + x
+ if call_args.length >= my_self.arity
+ my_self[*call_args]
else
+ args = call_args
f
end
}

0 comments on commit 67566e5

Please sign in to comment.