diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-09-23 15:52:54 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-09-23 15:55:58 -0700 |
commit | fae135c5b39db173bf97dfa3c3a34eb8fb230276 (patch) | |
tree | 2103dfd5fadf591c8785ccfc048b776289f759df | |
parent | 502c3ff02af189f3678187657c9a56a37e6a5a2a (diff) | |
download | ruby-fae135c5b39db173bf97dfa3c3a34eb8fb230276.tar.gz |
Document difference between Thread::Backtrace::Location#{,absolute_}path
They are usually the same, except for locations in the main script.
-rw-r--r-- | vm_backtrace.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c index bb650a66fd..0826ab0a2d 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -281,7 +281,9 @@ location_path(rb_backtrace_location_t *loc) } /* - * 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) /* * 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) |