るりまサーチ

最速Rubyリファレンスマニュアル検索!
26件ヒット [1-26件を表示] (0.081秒)
トップページ > クエリ:IO[x] > クエリ:p[x] > クエリ:backtrace_locations[x]

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. lupdecomposition p
  5. kernel $-p

ライブラリ

クラス

キーワード

検索結果

Exception#backtrace_locations -> [Thread::Backtrace::Location] (30313.0)

バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。

...バックトレース情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。

現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。

//emlist[例: test.rb][ruby]{
require...
...f get_exception
return begin
yield
rescue => e
e
end
end

e = get_exception { check_long_month(2) }
p
e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}

@see Exception#backtrac...

Exception#backtrace -> [String] (6012.0)

バックトレース情報を返します。

...)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)

という形式の String の配列です。

//emlist[例][ruby]{
def methd
raise
end

begin
methd
rescue => e
p
e.backtrace
end

#=> ["filename.rb:2:in `methd'", "filename.rb:6"]
//}

@see Exception#backtrace_locations...

NEWS for Ruby 3.0.0 (120.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Pro...
...cepting a single rest argument and no keywords.
16166

//emlist[][ruby]{
p
r = proc{|*a, **kw| [a, kw]}

p
r.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

p
r.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now suppo...
...king execution contexts. 16786
* Fiber#blocking? tells whether the fiber is non-blocking. 16786
* Fiber#backtrace and Fiber#backtrace_locations provide per-fiber backtrace. 16815
* The limitation of Fiber#transfer is relaxed. 17221
* GC
* GC.auto_compact= and GC.auto_compact have b...