mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Storing method-id inside Symbol#to_proc
When called in combination with a method like `*_eval` or `*_exec` that switches self, `__send__` was passed an object that was not necessarily a symbol as the method name. This problem was discovered during the #6389 correction process.
This commit is contained in:
+2
-1
@@ -1,7 +1,8 @@
|
||||
class Symbol
|
||||
def to_proc
|
||||
mid = self
|
||||
->(obj,*args,**opts,&block) do
|
||||
obj.__send__(self, *args, **opts, &block)
|
||||
obj.__send__(mid, *args, **opts, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user