1
0
Fork 0
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_3@62824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2018-03-18 15:23:34 +00:00
parent fdb2421c21
commit e9a9f674fb
4 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,7 @@
Mon Mar 19 00:22:52 2018 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
TracePoint#enable, #disable: Don't yield any argument. [Bug #14057]
Mon Mar 19 00:21:00 2018 SHIBATA Hiroshi <hsbt@ruby-lang.org>
Clarify the behavior of IO.write without offset in write mode.

View file

@ -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{

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.7"
#define RUBY_RELEASE_DATE "2018-03-19"
#define RUBY_PATCHLEVEL 424
#define RUBY_PATCHLEVEL 425
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 3

View file

@ -1087,7 +1087,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);
}
@ -1138,7 +1138,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);
}