Skip to content

Commit edbc6b5

Browse files
committed
fixup! src,lib: reducing C++ calls of esm legacy main resolve
Backport-PR-URL: nodejs#48325
1 parent f260c35 commit edbc6b5

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/internal/modules/esm/resolve.js

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const {
5353
ERR_PACKAGE_PATH_NOT_EXPORTED,
5454
ERR_UNSUPPORTED_DIR_IMPORT,
5555
ERR_NETWORK_IMPORT_DISALLOWED,
56+
ERR_INVALID_ARG_TYPE,
5657
} = require('internal/errors').codes;
5758

5859
const { Module: CJSModule } = require('internal/modules/cjs/loader');
@@ -1249,6 +1250,7 @@ module.exports = {
12491250
packageExportsResolve,
12501251
packageImportsResolve,
12511252
throwIfInvalidParentURL,
1253+
legacyMainResolve,
12521254
};
12531255

12541256
// cycle

src/node_file.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2633,8 +2633,9 @@ static bool FileURLToPath(
26332633
for (size_t i = 0; i < pathname_size; i++) {
26342634
if (pathname[i] == '/') {
26352635
pathname_escaped_slash += '\\';
2636-
} else
2636+
} else {
26372637
pathname_escaped_slash += pathname[i];
2638+
}
26382639

26392640
if (pathname[i] != '%') continue;
26402641

src/node_file.h

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ constexpr size_t kFsStatFsBufferLength =
5656

5757
class BindingData : public SnapshotableObject {
5858
public:
59-
6059
enum class FilePathIsFileReturnType {
6160
kIsFile = 0,
6261
kIsNotFile,

0 commit comments

Comments
 (0)