Skip to content

Commit fc6bdce

Browse files
committed
fs: add fast api for InternalModuleStat
nodejs/node#51344
1 parent 5ee874b commit fc6bdce

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,6 @@ index 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f9
2121
// process.config is serialized config.gypi
2222
const binding = internalBinding('builtins');
2323

24-
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
25-
index c794751ecd4448119ce33d661e694f83b3323f03..364469160af5e348f8890417de16a63c0d1dca67 100644
26-
--- a/lib/internal/modules/cjs/loader.js
27-
+++ b/lib/internal/modules/cjs/loader.js
28-
@@ -138,7 +138,7 @@ const {
29-
const assert = require('internal/assert');
30-
const fs = require('fs');
31-
const path = require('path');
32-
-const { internalModuleStat } = internalBinding('fs');
33-
+const internalFsBinding = internalBinding('fs');
34-
const { safeGetenv } = internalBinding('credentials');
35-
const {
36-
privateSymbols: {
37-
@@ -233,7 +233,7 @@ function stat(filename) {
38-
const result = statCache.get(filename);
39-
if (result !== undefined) { return result; }
40-
}
41-
- const result = internalModuleStat(filename);
42-
+ const result = internalFsBinding.internalModuleStat(filename);
43-
if (statCache !== null && result >= 0) {
44-
// Only set cache when `internalModuleStat(filename)` succeeds.
45-
statCache.set(filename, result);
4624
diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js
4725
index 88c079d10d116107aa34dc9281f64c799c48c0b5..069f922612777f226127dc44f4091eed30416925 100644
4826
--- a/lib/internal/modules/package_json_reader.js

0 commit comments

Comments
 (0)