Skip to content

Commit

Permalink
fixup! src: move package resolver to c++
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Nov 15, 2023
1 parent 7163dd0 commit ac44b0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/modules/run_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions src/node_modules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ac44b0c

Please sign in to comment.