electron/patches/node/make_module_globalpaths_a_reference.patch
Electron Bot 9713fa09e7 chore: bump node to v12.8.0 (master) (#19521)
* chore: bump node in DEPS to v12.7.0

* chore: update node patches v12.6 to v12.7

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: update build gn patch

* chore: bump node in DEPS to v12.8.0

* chore: update node patches v12.7 to v12.8

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: Add patch to revert crypto createhash changes

The original node commit contains changes/calls to functions that are not supported in boringssl.

* disable node tests

* Remove outdated patch, already merged upstream
2019-08-12 17:29:34 -07:00

26 lines
999 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Sun, 14 Apr 2013 15:54:46 +0800
Subject: Make Module.globalPaths a reference.
We need to hack the search paths of the require function so we can
load libraries from embedded applications without modifications of
node's module code.
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 95724d4c27f12e4f9c90f70b20d3d7fad3e9f035..2a1a412fe7c55b8046b19860005e89a52ee3b816 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1008,8 +1008,8 @@ Module._initPaths = function() {
modulePaths = paths;
- // Clone as a shallow copy, for introspection.
- Module.globalPaths = modulePaths.slice(0);
+ // clone as a shallow copy, for introspection.
+ Module.globalPaths = modulePaths;
};
Module._preloadModules = function(requests) {