mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: upgrade Node.js to v24.10.0 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup crypto patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup crypto test patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: prepare for v8 sandboxing https://github.com/nodejs/node/pull/58376 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * esm: fix module.exports export on CJS modules https://github.com/nodejs/node/pull/57366 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup lazyload fs patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * esm: Source Phase Imports for WebAssembly https://github.com/nodejs/node/pull/56919 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * module: remove --experimental-default-type https://github.com/nodejs/node/pull/56092 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * lib,src: refactor assert to load error source from memory https://github.com/nodejs/node/pull/59751 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: add source location to v8::TaskRunner https://github.com/nodejs/node/pull/54077 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: remove dependency on wrapper-descriptor-based CppHeap https://github.com/nodejs/node/pull/54077 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: do not use soon-to-be-deprecated V8 API https://github.com/nodejs/node/pull/53174 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: stop using deprecated fields of v8::FastApiCallbackOptions https://github.com/nodejs/node/pull/54077 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * test: update v8-stats test for V8 12.6 https://github.com/nodejs/node/pull/54077 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * esm: unflag --experimental-wasm-modules https://github.com/nodejs/node/pull/57038 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * test: adapt assert tests to stack trace changes https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src,test: unregister the isolate after disposal and before freeing https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use cppgc to manage ContextifyContext https://github.com/nodejs/node/pull/56522 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: replace uses of FastApiTypedArray https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * module: integrate TypeScript into compile cache https://github.com/nodejs/node/pull/56629 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * deps: update ada to 3.2.7 https://github.com/nodejs/node/pull/59336 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: make minor cleanups in encoding_binding.cc https://github.com/nodejs/node/pull/57448 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2` https://github.com/nodejs/node/pull/55453 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use non-deprecated Get/SetPrototype methods https://github.com/nodejs/node/pull/59671 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: simplify string_bytes with views https://github.com/nodejs/node/pull/54876 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: improve utf8 string generation performance https://github.com/nodejs/node/pull/54873 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use non-deprecated Utf8LengthV2() method https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use non-deprecated WriteUtf8V2() method https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: refactor WriteUCS2 and remove flags argument https://github.com/nodejs/node/pull/58163 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use String::WriteV2() in TwoByteValue https://github.com/nodejs/node/pull/58164 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * node-api: use WriteV2 in napi_get_value_string_utf16 https://github.com/nodejs/node/pull/58165 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * node-api: use WriteOneByteV2 in napi_get_value_string_latin1 https://github.com/nodejs/node/pull/58325 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: migrate WriteOneByte to WriteOneByteV2 https://github.com/nodejs/node/pull/59634 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fs: introduce dirent\.parentPath https://github.com/nodejs/node/pull/50976 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: avoid copy by using std::views::keys https://github.com/nodejs/node/pull/56080 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup patch indices Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: errant use of context->GetIsolate() Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: tweak BoringSSL compat patch for new changes Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: add back missing isolate dtor declaration Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fixup! esm: fix module.exports export on CJS modules Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * cli: remove --no-experimental-fetch flag https://github.com/nodejs/node/pull/52611/files Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * esm: Source Phase Imports for WebAssembly https://github.com/nodejs/node/pull/56919 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fixup! src: prepare for v8 sandboxing Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: bump @types/node to v24 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fix const assignment in crypto test Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: sandbox pointer patch issues Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: rework source phase import patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: add percentage support to --max-old-space-size https://github.com/nodejs/node/pull/59082 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fixup crypto tests Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: HostImportModuleWithPhaseDynamically todo Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: cjs esm failures Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: v8::Object::Wrappable issues -b72a615754-490bac2496-4896a0dd69Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: remove deleted specs Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * src: use v8::ExternalMemoryAccounter https://github.com/nodejs/node/pull/58070 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fs: port SonicBoom module to fs module as FastUtf8Stream https://github.com/nodejs/node/pull/58897 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: tweak sandboxed pr patch Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * test: disable parallel/test-os-checked-function Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * test: use WHATWG URL instead of url.parse Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: OPENSSL_secure_zalloc doesn't work in BoringSSL Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: fix accidental extra line Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * 7017517: [defer-import-eval] Parse import defer syntax https://chromium-review.googlesource.com/c/v8/v8/+/7017517 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
41 lines
1.9 KiB
Diff
41 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Sun, 27 Mar 2016 14:42:26 +0900
|
|
Subject: Pass all globals through "require"
|
|
|
|
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
|
|
|
|
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
|
index 8a28cd0e497911550cb0fa889c4f2f780d86c24b..811a2961834b9648f5f6b51c3bda570541413818 100644
|
|
--- a/lib/internal/modules/cjs/loader.js
|
|
+++ b/lib/internal/modules/cjs/loader.js
|
|
@@ -208,6 +208,13 @@ const {
|
|
CHAR_FORWARD_SLASH,
|
|
} = require('internal/constants');
|
|
|
|
+// Store the "global" variable from global scope into a local scope, so we can
|
|
+// still reference it from this file even after we deleted the "global" variable
|
|
+// from the global scope.
|
|
+const localGlobal = (typeof global !== 'undefined') ? global : undefined;
|
|
+// Do the same for "Buffer".
|
|
+const localBuffer = (typeof Buffer !== 'undefined') ? Buffer : undefined;
|
|
+
|
|
const {
|
|
isProxy,
|
|
} = require('internal/util/types');
|
|
@@ -1755,10 +1762,12 @@ Module.prototype._compile = function(content, filename, format) {
|
|
if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) {
|
|
const { callAndPauseOnStart } = internalBinding('inspector');
|
|
result = callAndPauseOnStart(compiledWrapper, thisValue, exports,
|
|
- require, module, filename, dirname);
|
|
+ require, module, filename, dirname,
|
|
+ process, localGlobal, localBuffer);
|
|
} else {
|
|
result = ReflectApply(compiledWrapper, thisValue,
|
|
- [exports, require, module, filename, dirname]);
|
|
+ [exports, require, module, filename, dirname,
|
|
+ process, localGlobal, localBuffer]);
|
|
}
|
|
this[kIsExecuting] = false;
|
|
if (requireDepth === 0) { statCache = null; }
|