T. Onoma
9/30/2004 2:05:00 AM
On Wednesday 29 September 2004 04:45 pm, Paul Brannan wrote:
> On Thu, Sep 30, 2004 at 04:42:02AM +0900, trans. (T. Onoma) wrote:
> > Oh, and also, why is set_trace_func turning up with nil binding?
>
> Can you post a short sample that produces this?
Thanks for asking, since I may not have bothered to do this otherwise. It
looks like the binding is nil the same time that the class is false --on
'end' events. At least that's when it turns up with this example:
01 set_trace_func proc{ |e, f, l, m, b, k|
02 puts "#{e}, #{f}, #{l}, #{m}, #{k}" if ! b
03 }
04
05 module T
06 # setup
07 class Test
08 def initialize; @example = true; end
09 def test; "Okay!"; end
10 end
11 end
12
13 t = T::Test.new
14 t.test
15 t.test
Which returns:
end, t.rb, 7, , false
end, t.rb, 5, , false
I'm not sure why this would be. Isn't there always a context? Also I find the
line numbers odd (I added for easy reading), those mark where the 'class'
event occurs.
T.