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:
dearblue
2024-10-27 10:41:51 +09:00
parent 38487f2100
commit a7a81aa761
+2 -1
View File
@@ -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