Skip to content

Commit 60f787b

Browse files
authored
Merge branch 'master' into st0012-improve-test-process-kill-signaling
2 parents 8b02ed6 + f1f9211 commit 60f787b

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

lib/debug/server_cdp.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def run_new_chrome
9898
candidates = ['C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe']
9999
path = get_chrome_path candidates
100100
end
101-
uuid = SecureRandom.uuid
102101
# The path is based on https://github.com/sindresorhus/open/blob/v8.4.0/index.js#L128.
103102
stdin, stdout, stderr, wait_thr = *Open3.popen3("#{ENV['SystemRoot']}\\System32\\WindowsPowerShell\\v1.0\\powershell")
104103
tf = Tempfile.create(['debug-', '.txt'])

lib/debug/server_dap.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,17 +251,17 @@ class RetryBecauseCantRead < Exception
251251
end
252252

253253
def recv_request
254-
r = IO.select([@sock])
254+
IO.select([@sock])
255255

256256
@session.process_group.sync do
257257
raise RetryBecauseCantRead unless IO.select([@sock], nil, nil, 0)
258258

259-
case header = @sock.gets
259+
case @sock.gets
260260
when /Content-Length: (\d+)/
261261
b = @sock.read(2)
262262
raise b.inspect unless b == "\r\n"
263263

264-
l = @sock.read(s = $1.to_i)
264+
l = @sock.read($1.to_i)
265265
show_protocol :>, l
266266
JSON.load(l)
267267
when nil
@@ -551,7 +551,7 @@ def process_protocol_request req
551551
when 'stackTrace'
552552
tid = req.dig('arguments', 'threadId')
553553

554-
if tc = find_waiting_tc(tid)
554+
if find_waiting_tc(tid)
555555
request_tc [:dap, :backtrace, req]
556556
else
557557
fail_response req
@@ -560,7 +560,7 @@ def process_protocol_request req
560560
frame_id = req.dig('arguments', 'frameId')
561561
if @frame_map[frame_id]
562562
tid, fid = @frame_map[frame_id]
563-
if tc = find_waiting_tc(tid)
563+
if find_waiting_tc(tid)
564564
request_tc [:dap, :scopes, req, fid]
565565
else
566566
fail_response req
@@ -596,7 +596,7 @@ def process_protocol_request req
596596
frame_id = ref[1]
597597
tid, fid = @frame_map[frame_id]
598598

599-
if tc = find_waiting_tc(tid)
599+
if find_waiting_tc(tid)
600600
request_tc [:dap, :scope, req, fid]
601601
else
602602
fail_response req
@@ -605,7 +605,7 @@ def process_protocol_request req
605605
when :variable
606606
tid, vid = ref[1], ref[2]
607607

608-
if tc = find_waiting_tc(tid)
608+
if find_waiting_tc(tid)
609609
request_tc [:dap, :variable, req, vid]
610610
else
611611
fail_response req
@@ -624,7 +624,7 @@ def process_protocol_request req
624624
tid, fid = @frame_map[frame_id]
625625
expr = req.dig('arguments', 'expression')
626626

627-
if tc = find_waiting_tc(tid)
627+
if find_waiting_tc(tid)
628628
request_tc [:dap, :evaluate, req, fid, expr, context]
629629
else
630630
fail_response req
@@ -645,7 +645,7 @@ def process_protocol_request req
645645
frame_id = req.dig('arguments', 'frameId')
646646
tid, fid = @frame_map[frame_id]
647647

648-
if tc = find_waiting_tc(tid)
648+
if find_waiting_tc(tid)
649649
text = req.dig('arguments', 'text')
650650
line = req.dig('arguments', 'line')
651651
if col = req.dig('arguments', 'column')

lib/debug/source_repository.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def orig_src iseq
4949
lines = iseq.script_lines&.map(&:chomp)
5050
line = iseq.first_line
5151
if line > 1
52-
lines = [*([''] * (line - 1)), *lines]
52+
[*([''] * (line - 1)), *lines]
5353
else
5454
lines
5555
end

test/support/protocol_test_case.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,4 +1065,3 @@ def parse_ k, v
10651065
end
10661066
end
10671067
end
1068-

test/support/test_case.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def get_request host, port, path
227227
sock.print "GET #{path} HTTP/1.1\r\n"
228228
sock.close_write
229229
loop do
230-
case header = sock.gets
230+
case sock.gets
231231
when /Content-Length: (\d+)/
232232
b = sock.read(2)
233233
raise b.inspect unless b == "\r\n"

test/tool/test_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def activate_debugger
477477
when /\[\>\]\s(.*)/
478478
begin
479479
req = JSON.parse $1
480-
rescue JSON::ParserError => e
480+
rescue JSON::ParserError
481481
$stderr.print data
482482
next
483483
end
@@ -504,7 +504,7 @@ def activate_debugger
504504
when /\[\<\]\s(.*)/
505505
begin
506506
res = JSON.parse $1
507-
rescue JSON::ParserError => e
507+
rescue JSON::ParserError
508508
$stderr.print data
509509
next
510510
end

0 commit comments

Comments
 (0)