From ae35d45846307ed1e17727fe2238f154d00ea67a Mon Sep 17 00:00:00 2001 From: a_matsuda Date: Sat, 28 Oct 2017 06:49:50 +0000 Subject: [PATCH] Fix example that trace method is called outside block [ci skip] `TracePoint` doesn't have the `line` method. Therefore, this example will raise `NoMethodError`. But since it does not seem to be the intended error, use the existing `lineno` method instead. Patch by: yuuji.yaginuma https://github.com/ruby/ruby/pull/1731 [Fix GH-1731] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm_trace.c b/vm_trace.c index bedcb82ebb..87d6e53345 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -1263,7 +1263,7 @@ rb_tracepoint_new(VALUE target_thval, rb_event_flag_t events, void (*func)(VALUE * TracePoint.trace(:line) do |tp| * $tp = tp * end - * $tp.line #=> access from outside (RuntimeError) + * $tp.lineno #=> access from outside (RuntimeError) * * Access from other threads is also forbidden. *