mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 60437: [Backport #14057]
TracePoint#enable, #disable: Don't yield any argument. [Bug #14057] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
072ef48c5b
commit
acbf49de47
3 changed files with 13 additions and 7 deletions
|
@ -639,16 +639,19 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||
|
||||
def test_tracepoint_enable
|
||||
ary = []
|
||||
args = nil
|
||||
trace = TracePoint.new(:call){|tp|
|
||||
next if !target_thread?
|
||||
ary << tp.method_id
|
||||
}
|
||||
foo
|
||||
trace.enable{
|
||||
trace.enable{|*a|
|
||||
args = a
|
||||
foo
|
||||
}
|
||||
foo
|
||||
assert_equal([:foo], ary)
|
||||
assert_equal([], args)
|
||||
|
||||
trace = TracePoint.new{}
|
||||
begin
|
||||
|
@ -663,17 +666,20 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||
|
||||
def test_tracepoint_disable
|
||||
ary = []
|
||||
args = nil
|
||||
trace = TracePoint.trace(:call){|tp|
|
||||
next if !target_thread?
|
||||
ary << tp.method_id
|
||||
}
|
||||
foo
|
||||
trace.disable{
|
||||
trace.disable{|*a|
|
||||
args = a
|
||||
foo
|
||||
}
|
||||
foo
|
||||
trace.disable
|
||||
assert_equal([:foo, :foo], ary)
|
||||
assert_equal([], args)
|
||||
|
||||
trace = TracePoint.new{}
|
||||
trace.enable{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#define RUBY_VERSION "2.4.4"
|
||||
#define RUBY_RELEASE_DATE "2018-03-07"
|
||||
#define RUBY_PATCHLEVEL 255
|
||||
#define RUBY_RELEASE_DATE "2018-03-08"
|
||||
#define RUBY_PATCHLEVEL 256
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2018
|
||||
#define RUBY_RELEASE_MONTH 3
|
||||
#define RUBY_RELEASE_DAY 7
|
||||
#define RUBY_RELEASE_DAY 8
|
||||
|
||||
#include "ruby/version.h"
|
||||
|
||||
|
|
|
@ -1103,7 +1103,7 @@ tracepoint_enable_m(VALUE tpval)
|
|||
rb_tracepoint_enable(tpval);
|
||||
|
||||
if (rb_block_given_p()) {
|
||||
return rb_ensure(rb_yield, Qnil,
|
||||
return rb_ensure(rb_yield, Qundef,
|
||||
previous_tracing ? rb_tracepoint_enable : rb_tracepoint_disable,
|
||||
tpval);
|
||||
}
|
||||
|
@ -1154,7 +1154,7 @@ tracepoint_disable_m(VALUE tpval)
|
|||
rb_tracepoint_disable(tpval);
|
||||
|
||||
if (rb_block_given_p()) {
|
||||
return rb_ensure(rb_yield, Qnil,
|
||||
return rb_ensure(rb_yield, Qundef,
|
||||
previous_tracing ? rb_tracepoint_enable : rb_tracepoint_disable,
|
||||
tpval);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue