Skip to content

Commit

Permalink
restrict skip to ruby 3.1 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
WillHalto authored and ko1 committed Nov 2, 2022
1 parent 0476b3d commit ad1bcb1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ def initialize

@tp_thread_begin = nil
@tp_load_script = TracePoint.new(:script_compiled){|tp|
# skip on_load if no bps for faster loading
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script if @bps.any?
if RUBY_VERSION >= '3.1.0'
# skip on_load if no bps for faster loading
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script if @bps.any?
else
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script
end
}
@tp_load_script.enable

Expand Down

0 comments on commit ad1bcb1

Please sign in to comment.