[前][次][番号順一覧][スレッド一覧]

ruby-changes:48386

From: a_matsuda <ko1@a...>
Date: Sat, 28 Oct 2017 15:49:58 +0900 (JST)
Subject: [ruby-changes:48386] a_matsuda:r60500 (trunk): Fix example that trace method is called outside block

a_matsuda	2017-10-28 15:49:50 +0900 (Sat, 28 Oct 2017)

  New Revision: 60500

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60500

  Log:
    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@g...>
    
    https://github.com/ruby/ruby/pull/1731
    [Fix GH-1731]

  Modified files:
    trunk/vm_trace.c
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 60499)
+++ vm_trace.c	(revision 60500)
@@ -1263,7 +1263,7 @@ rb_tracepoint_new(VALUE target_thval, rb https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1263
  *      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.
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]