Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use TOPLEVEL_BINDING if no binding #859

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def frame_eval_core src, b, binding_location: false
def frame_eval src, re_raise: false, binding_location: false
@success_last_eval = false

b = current_frame.eval_binding
b = current_frame&.eval_binding || TOPLEVEL_BINDING

special_local_variables current_frame do |name, var|
b.local_variable_set(name, var) if /\%/ !~ name
Expand Down Expand Up @@ -810,7 +810,7 @@ def make_breakpoint args
case args.first
when :method
klass_name, op, method_name, cond, cmd, path = args[1..]
bp = MethodBreakpoint.new(current_frame.eval_binding, klass_name, op, method_name, cond: cond, command: cmd, path: path)
bp = MethodBreakpoint.new(current_frame&.eval_binding || TOPLEVEL_BINDING, klass_name, op, method_name, cond: cond, command: cmd, path: path)
begin
bp.enable
rescue NameError => e
Expand Down