Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const fs = require('fs');
const internalFS = require('internal/fs/utils');
const path = require('path');
const { sep } = path;
const { internalModuleStat } = internalBinding('fs');
const internalFsBinding = internalBinding('fs');
const packageJsonReader = require('internal/modules/package_json_reader');
const { safeGetenv } = internalBinding('credentials');
const {
Expand Down Expand Up @@ -154,7 +154,7 @@ function stat(filename) {
const result = statCache.get(filename);
if (result !== undefined) return result;
}
const result = internalModuleStat(filename);
const result = internalFsBinding.internalModuleStat(filename);
if (statCache !== null && result >= 0) {
// Only set cache when `internalModuleStat(filename)` succeeds.
statCache.set(filename, result);
Expand Down
7 changes: 3 additions & 4 deletions lib/internal/modules/package_json_reader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { SafeMap } = primordials;
const { internalModuleReadJSON } = internalBinding('fs');
const internalFsBinding = internalBinding('fs');
const { pathToFileURL } = require('url');
const { toNamespacedPath } = require('path');

Expand All @@ -18,9 +18,8 @@ function read(jsonPath) {
return cache.get(jsonPath);
}

const { 0: string, 1: containsKeys } = internalModuleReadJSON(
toNamespacedPath(jsonPath)
);
const { 0: string, 1: containsKeys } =
internalFsBinding.internalModuleReadJSON(toNamespacedPath(jsonPath));
const result = { string, containsKeys };
const { getOptionValue } = require('internal/options');
if (string !== undefined) {
Expand Down