Actions
Bug #8722
closedRefinements remain active beyond the end of an evaled string
Description
=begin
The [[RefinementsSpec]] states:
"When main.using is invoked in a string given as the first argument of Kernel#eval, Kernel#instance_eval, or Module#module_eval, the end of the scope is the end of the string."
However, in this example script, String#upcase remains refined even after the call to eval() has finished:
module M
refine String do
def upcase
reverse
end
end
end
puts "hello world".upcase
puts eval(%{using M; "hello world".upcase})
puts "hello world".upcase
I would expect the output of this script to be:
HELLO WORLD
dlrow olleh
HELLO WORLD
Instead it is:
HELLO WORLD
dlrow olleh
dlrow olleh
=end
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0