eval_script -> String | nilRuby 2.6.0 から[permalink][rdoc][edit]-
script_compiledイベント発生時にコンパイルされたソースコードを返します。ファイルから読み込んだ場合は、nilを返します。
例TracePoint.new(:script_compiled) do |tp| p tp.eval_script # => "puts 'hello'" end.enable do eval("puts 'hello'") end- [EXCEPTION]
RuntimeError: - :script_compiled イベントのためのイベントフックの外側で実行した場合に発生します。
- [EXCEPTION]