Skip to content

Commit 262f2cb

Browse files
anonrigaduh95
authored andcommitted
esm: remove unnecessary toNamespacedPath calls
PR-URL: #53656 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent cbe77b3 commit 262f2cb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎lib/internal/modules/esm/resolve.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { BuiltinModule } = require('internal/bootstrap/realm');
2727
const{ realpathSync }=require('fs');
2828
const{ getOptionValue }=require('internal/options');
2929
// Do not eagerly grab .manifest, it may be in TDZ
30-
const{ sep,posix: {relative: relativePosixPath},toNamespacedPath,resolve }=require('path');
30+
const{ sep,posix: {relative: relativePosixPath}, resolve }=require('path');
3131
constpreserveSymlinks=getOptionValue('--preserve-symlinks');
3232
constpreserveSymlinksMain=getOptionValue('--preserve-symlinks-main');
3333
constexperimentalNetworkImports=
@@ -246,8 +246,8 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
246246
throwerr;
247247
}
248248

249-
conststats=internalFsBinding.internalModuleStat(toNamespacedPath(StringPrototypeEndsWith(path,'/') ?
250-
StringPrototypeSlice(path,-1) : path));
249+
conststats=internalFsBinding.internalModuleStat(StringPrototypeEndsWith(path,'/') ?
250+
StringPrototypeSlice(path,-1) : path);
251251

252252
// Check for stats.isDirectory()
253253
if(stats===1){
@@ -807,7 +807,7 @@ function packageResolve(specifier, base, conditions) {
807807
letlastPath;
808808
do{
809809
conststat=internalFsBinding.internalModuleStat(
810-
toNamespacedPath(StringPrototypeSlice(packageJSONPath,0,packageJSONPath.length-13)),
810+
StringPrototypeSlice(packageJSONPath,0,packageJSONPath.length-13),
811811
);
812812
// Check for !stat.isDirectory()
813813
if(stat!==1){

0 commit comments

Comments
 (0)