mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
path: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/37893 Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This commit is contained in:
committed by
ZiJian Liu
parent
31fe3b215f
commit
3ef95627cc
@@ -163,7 +163,7 @@ const win32 = {
|
||||
// Verify that a cwd was found and that it actually points
|
||||
// to our drive. If not, default to the drive's root.
|
||||
if (path === undefined ||
|
||||
(StringPrototypeSlice(path, 0, 2).toLowerCase() !==
|
||||
(StringPrototypeToLowerCase(StringPrototypeSlice(path, 0, 2)) !==
|
||||
StringPrototypeToLowerCase(resolvedDevice) &&
|
||||
StringPrototypeCharCodeAt(path, 2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
@@ -1321,7 +1321,7 @@ const posix = {
|
||||
return StringPrototypeSlice(path, startDot, end);
|
||||
},
|
||||
|
||||
format: _format.bind(null, '/'),
|
||||
format: FunctionPrototypeBind(_format, null, '/'),
|
||||
|
||||
parse(path) {
|
||||
validateString(path, 'path');
|
||||
|
||||
Reference in New Issue
Block a user