Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 1e32a4f

Browse files
committed
update resolveFullPath_ to use stripFileProtocol_
1 parent 2afe051 commit 1e32a4f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/agent/state/inspector-state.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,9 @@ class StateResolver {
278278
return '';
279279
}
280280
const scriptUrl = this.scriptmapper[scriptId].url;
281-
if (scriptUrl.startsWith('file://')) {
282-
// In Node 11+, non-internal files are formatted as URLs, so get just the
283-
// path.
284-
return scriptUrl.slice('file://'.length);
285-
} else {
286-
// Internal files should be returned as is.
287-
return scriptUrl;
288-
}
281+
// In Node 11+, non-internal files are formatted as URLs, so get just the
282+
// path.
283+
return StateResolver.stripFileProtocol_(scriptUrl);
289284
}
290285

291286
resolveRelativePath_(frame: inspector.Debugger.CallFrame): string {
@@ -306,7 +301,6 @@ class StateResolver {
306301
}
307302

308303
isPathInCurrentWorkingDirectory_(path: string): boolean {
309-
// return true;
310304
return StateResolver.stripFileProtocol_(path).indexOf(
311305
this.config.workingDirectory) === 0;
312306
}

0 commit comments

Comments
 (0)