From d7bf3ef5d3bba1e92bd58f93123a9527037983b8 Mon Sep 17 00:00:00 2001 From: Naoto Ono Date: Sat, 22 Oct 2022 22:17:01 +0900 Subject: [PATCH] Support BasicObject in Chrome debugging --- lib/debug/server_cdp.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/debug/server_cdp.rb b/lib/debug/server_cdp.rb index b6d88b632..c5067a1bb 100644 --- a/lib/debug/server_cdp.rb +++ b/lib/debug/server_cdp.rb @@ -872,8 +872,8 @@ def process_cdp args result = b.local_variable_get(expr) rescue NameError # try to check method - if b.receiver.respond_to? expr, include_all: true - result = b.receiver.method(expr) + if M_RESPOND_TO_P.bind_call(b.receiver, expr, include_all: true) + result = M_METHOD.bind_call(b.receiver, expr) else message = "Error: Can not evaluate: #{expr.inspect}" end @@ -987,10 +987,10 @@ def process_cdp args ] end - result += obj.instance_variables.map{|iv| - variable(iv, obj.instance_variable_get(iv)) + result += M_INSTANCE_VARIABLES.bind_call(obj).map{|iv| + variable(iv, M_INSTANCE_VARIABLE_GET.bind_call(obj, iv)) } - prop += [internalProperty('#class', obj.class)] + prop += [internalProperty('#class', M_CLASS.bind_call(obj))] end event! :cdp_result, :properties, req, result: result, internalProperties: prop end @@ -1045,7 +1045,7 @@ def propertyDescriptor_ name, obj, type, description: nil, subtype: nil v = prop[:value] v.delete :value v[:subtype] = subtype if subtype - v[:className] = obj.class + v[:className] = (klass = M_CLASS.bind_call(obj)).name || klass.to_s end prop end