Skip to content

Commit a12da10

Browse files
committed
esm: remove check for trailing slash during resolve
The check was incorrectly altered in #54408, passing the bindings as argument for `this` instead of the path string. This check not working having no significant impact on Node.js as far as I can tell, this changes removes it altogether to avoid undesired overhead. Signed-off-by: Cynthia Rey <[email protected]>
1 parent 8456a12 commit a12da10

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/internal/modules/esm/resolve.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
247247
throw err;
248248
}
249249

250-
const stats = internalFsBinding.internalModuleStat(
251-
internalFsBinding,
252-
StringPrototypeEndsWith(internalFsBinding, path, '/') ? StringPrototypeSlice(path, -1) : path,
253-
);
250+
const stats = internalFsBinding.internalModuleStat(internalFsBinding, path);
254251

255252
// Check for stats.isDirectory()
256253
if (stats === 1) {

0 commit comments

Comments
 (0)