Skip to content

Commit

Permalink
Rename "abs" to "path" for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ono-max committed Dec 6, 2021
1 parent 3cc01cf commit 5ed568c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/debug/server_cdp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def process

## boot/configuration
when 'Page.getResourceTree'
abs = File.absolute_path($0)
src = File.read(abs)
@src_map[abs] = src
path = File.absolute_path($0)
src = File.read(path)
@src_map[path] = src
send_response req,
frameTree: {
frame: {
Expand All @@ -126,8 +126,8 @@ def process
]
}
send_event 'Debugger.scriptParsed',
scriptId: abs,
url: "http://debuggee#{abs}",
scriptId: path,
url: "http://debuggee#{path}",
startLine: 0,
startColumn: 0,
endLine: src.count("\n"),
Expand Down Expand Up @@ -415,23 +415,21 @@ def process_cdp args
callFrames: @target_frames.map.with_index{|frame, i|
path = frame.realpath || frame.path
if path.match /<internal:(.*)>/
abs = $1
else
abs = path
path = $1
end

call_frame = {
callFrameId: SecureRandom.hex(16),
functionName: frame.name,
functionLocation: {
scriptId: abs,
scriptId: path,
lineNumber: 0
},
location: {
scriptId: abs,
scriptId: path,
lineNumber: frame.location.lineno - 1 # The line number is 0-based.
},
url: "http://debuggee#{abs}",
url: "http://debuggee#{path}",
scopeChain: [
{
type: 'local',
Expand Down

0 comments on commit 5ed568c

Please sign in to comment.