electron/patches/node/fixme_use_redefined_version_of_internalmodulestat.patch
2019-07-17 14:22:27 -07:00

24 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 13 Sep 2018 09:10:02 -0700
Subject: FIXME: use redefined version of internalModuleStat
Instantiate redefined version of the internalModuleStat function
(see lib/common/asar.js in the electron/electron repo). For some reason
this has to be done after the upgrade to the Node.js v8.7.0. `const
internalModuleStat` in the very beginning of the file holds a reference
to a native Node.js implementation of the function.
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index b6bef5f0fdb6f60e4baf5fbd647f191a0e290355..2f5385cea51d3456dffb43a852bd2b3cdce9998b 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -85,6 +85,8 @@ const relativeResolveCache = Object.create(null);
let requireDepth = 0;
let statCache = null;
function stat(filename) {
+ // FIXME(codebytere): determine why this needs to be done and remove
+ const internalModuleStat = process.binding('fs').internalModuleStat;
filename = path.toNamespacedPath(filename);
if (statCache !== null) {
const result = statCache.get(filename);