From ac44b0c103fc84cd44831a828b0abc3813867b27 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 14 Nov 2023 17:15:28 -0500 Subject: [PATCH] fixup! src: move package resolver to c++ --- lib/internal/modules/run_main.js | 2 +- src/node_modules.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js index 2e7c3429c8561e3..23268637e4fd58c 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -70,7 +70,7 @@ function shouldUseESMLoader(mainPath) { if (mainPath && StringPrototypeEndsWith(mainPath, '.mjs')) { return true; } if (!mainPath || StringPrototypeEndsWith(mainPath, '.cjs')) { return false; } - const response = getNearestParentPackageJSONType(path.toNamespacedPath(mainPath)); + const response = getNearestParentPackageJSONType(mainPath); // No package.json or no `type` field. if (response === undefined || response[0] === 'none') { diff --git a/src/node_modules.cc b/src/node_modules.cc index c5f80aaf3eeb623..ffe9fdf3f2ccdf3 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc @@ -36,8 +36,8 @@ using v8::Value; constexpr char kPathSeparator = '/'; constexpr std::string_view kNodeModules = "/node_modules"; #else -const char* const kPathSeparator = "\\/"; -constexpr std::string_view kNodeModules = "\\/node_modules"; +constexpr char kPathSeparator = '\\'; +constexpr std::string_view kNodeModules = "\\node_modules"; #endif void BindingData::MemoryInfo(MemoryTracker* tracker) const {