From: Marc-Andre Lafortune Date: 2009-09-15T02:31:22+09:00 Subject: [ruby-core:25593] [Bug #146] Incorrect line numbers in "caller" output when evaluated in a Proc binding Issue #146 has been updated by Marc-Andre Lafortune. Category set to core ruby -v set to - The expected output should be the same for eval("p caller(0)", first.binding) and eval("p caller(0)", second.binding) since the block has the same binding (i.e. that of second). At the moment "p caller" is evaluated, both first and second have returned, so the output should not contain "proc_caller.rb:6". In neither case should we expect to see "proc_caller.rb:2:in `first'" in the backtrace. It appears that when a block is captured (here by third), the binding is set the the full stack instead of just that of second. This leads to a longer backtrace, as seen with the output of caller or if an exception is raised in the eval. Just to confirm that this bug is not present in Ruby 1.9; the output is quite sensible and the same from both first.binding and second.binding. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/146 ---------------------------------------- http://redmine.ruby-lang.org