Actions
Bug #1926
closedDifferent eval/binding behaviour in 1.9
Description
=begin
In 1.8.6, you can set a local variable in a binding using eval. This doesn't seem to work in 1.9.2-preview1.
def define_a(b)
eval "a=1", b
end
define_a(binding)
puts local_variables.inspect
1.8: prints ["a"]¶
1.9: prints []¶
Similarly:
def another_a(&blk)
eval "a=1", blk.binding
yield
end
another_a do
puts local_variables.inspect
end
1.8: prints ["a"]¶
1.9: prints []¶
=end
Actions
Like0
Like0Like0Like0Like0