1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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 <yuuji.yaginuma@gmail.com>

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
This commit is contained in:
a_matsuda 2017-10-28 06:49:50 +00:00
parent 4563273909
commit ae35d45846

View file

@ -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.
*