From: "deivid (David Rodríguez)" Date: 2013-07-15T18:26:34+09:00 Subject: [ruby-core:56012] [ruby-trunk - Bug #8622] Tracepoint API: B_RETURN_EVENT not triggered when "return" used inside lambda Issue #8622 has been updated by deivid (David Rodr��guez). =begin Notice that I am blaming "return" because this doesn't happen if "return" is not explicited. TracePoint.new(:b_call, :b_return) do |tp| warn tp.event end.enable a = lambda { "hola" }.call # Output: # b_call # b_return =end Thanks! ---------------------------------------- Bug #8622: Tracepoint API: B_RETURN_EVENT not triggered when "return" used inside lambda https://bugs.ruby-lang.org/issues/8622#change-40503 Author: deivid (David Rodr��guez) Status: Open Priority: Normal Assignee: ko1 (Koichi Sasada) Category: core Target version: current: 2.1.0 ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN =begin I'm using the Tracepoint API in my gem and I noticed that when the keyword `return` is used inside a lambda, a block return event (B_RETURN_EVENT) is not triggered. For example, I would expect the same number of B_CALL_EVENT and B_RETURN_EVENT in the piece of code TracePoint.new(:b_call, :b_return) do |tp| warn tp.event end.enable a = lambda { return "hola" }.call # Output: # b_call # # Expected Output: # b_call # b_return This seems very similar to issue #8489, so hopefully the fix would be as simple as that one. Thanks a lot. =end -- http://bugs.ruby-lang.org/