-
Notifications
You must be signed in to change notification settings - Fork 30k
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
url: use resolved path to convert to fileURL
#56302
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56302 +/- ##
==========================================
+ Coverage 88.04% 88.54% +0.50%
==========================================
Files 657 657
Lines 190290 190290
Branches 36245 36531 +286
==========================================
+ Hits 167536 168496 +960
+ Misses 15893 14983 -910
+ Partials 6861 6811 -50
|
@@ -1512,32 +1512,32 @@ function fileURLToPath(path, options = kEmptyObject) { | |||
|
|||
function pathToFileURL(filepath, options = kEmptyObject) { | |||
const windows = options?.windows ?? isWindows; | |||
if (windows && StringPrototypeStartsWith(filepath, '\\\\')) { | |||
let resolved = windows ? path.win32.resolve(filepath) : path.posix.resolve(filepath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of introducing a new variable named resolved
and renaming the existing parameter filepath
, rename the input parameter to filepathOriginal
and create a new variable filepath
for the modified version of the original path.
let resolved = windows ? path.win32.resolve(filepath) : path.posix.resolve(filepath); | |
let filepath = windows ? path.win32.resolve(filepathOriginal) : path.posix.resolve(filepathOriginal); |
@@ -1512,32 +1512,32 @@ function fileURLToPath(path, options = kEmptyObject) { | |||
|
|||
function pathToFileURL(filepath, options = kEmptyObject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepathOriginal
or filepathUnresolved
Only matters if the CWD is a UNC path, which is hard to write a test for.
Fixes: #56262