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

ruby-changes:63056

From: Jeremy <ko1@a...>
Date: Thu, 24 Sep 2020 07:57:26 +0900 (JST)
Subject: [ruby-changes:63056] fae135c5b3 (master): Document difference between Thread::Backtrace::Location#{, absolute_}path

https://git.ruby-lang.org/ruby.git/commit/?id=fae135c5b3

From fae135c5b39db173bf97dfa3c3a34eb8fb230276 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Wed, 23 Sep 2020 15:52:54 -0700
Subject: Document difference between
 Thread::Backtrace::Location#{,absolute_}path

They are usually the same, except for locations in the main script.

diff --git a/vm_backtrace.c b/vm_backtrace.c
index bb650a6..0826ab0 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -281,7 +281,9 @@ location_path(rb_backtrace_location_t *loc) https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L281
 }
 
 /*
- * Returns the file name of this frame.
+ * Returns the file name of this frame. This will generally be an absolute
+ * path, unless the frame is in the main script, in which case it will be the
+ * script location passed on the command line.
  *
  * For example, using +caller_locations.rb+ from Thread::Backtrace::Location
  *
@@ -315,7 +317,8 @@ location_realpath(rb_backtrace_location_t *loc) https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L317
 /*
  * Returns the full file path of this frame.
  *
- * Same as #path, but includes the absolute path.
+ * Same as #path, except that it will return absolute path
+ * even if the frame is in the main script.
  */
 static VALUE
 location_absolute_path_m(VALUE self)
-- 
cgit v0.10.2


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

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