chore: bump node to v20.19.0 (34-x-y) (#46037)

* chore: bump node in DEPS to v20.19.0

* deps, src: simplifying base64 encoding

https://github.com/nodejs/node/pull/52714

* module: simplify --inspect-brk handling

https://github.com/nodejs/node/pull/55679

* test: make test-crypto-hash compatible with OpenSSL > 3.4.0

https://github.com/nodejs/node/pull/56160

* module: refactor ESM loader for adding future synchronous hooks

https://github.com/nodejs/node/pull/54769

* module: detect ESM syntax by trying to recompile as SourceTextModule

https://github.com/nodejs/node/pull/52413

* worker: add postMessageToThread

https://github.com/nodejs/node/pull/53682

* backport unflagging of require(esm) to v20

https://github.com/nodejs/node/pull/56927

* module: detect ESM syntax by trying to recompile as SourceTextModule

https://github.com/nodejs/node/pull/52413

* chore: fixup patch indices

* chore: handle filename.json changes

- https://github.com/nodejs/node/pull/51711
- https://github.com/nodejs/node/pull/53573

* src: refactor embedded entrypoint loading

https://github.com/nodejs/node/pull/53573

* lib: allow CJS source map cache to be reclaimed

https://github.com/nodejs/node/pull/51711

* test: make eval snapshot tests more flexible

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
electron-roller[bot]
2025-04-01 20:51:57 +02:00
committed by GitHub
parent b241c0d98a
commit 8bfd7f05ac
34 changed files with 264 additions and 311 deletions

2
DEPS
View File

@@ -4,7 +4,7 @@ vars = {
'chromium_version':
'132.0.6834.210',
'node_version':
'v20.18.3',
'v20.19.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':

View File

@@ -54,3 +54,4 @@ build_restore_clang_as_default_compiler_on_macos.patch
esm_drop_support_for_import_assertions.patch
build_remove_explicit_linker_call_to_libm_on_macos.patch
build_define_nominmax_in_common_gypi.patch
test_make_eval_snapshot_tests_more_flexible.patch

View File

@@ -11,7 +11,7 @@ really in 20/21. We have to wait until 22 is released to be able to
build with upstream GN files.
diff --git a/BUILD.gn b/BUILD.gn
index 1ed186b597eece7c34cb69c8e1e20870555a040d..2ce1e8a7dcca2ba153d387d11970c72b5f43c167 100644
index 1ed186b597eece7c34cb69c8e1e20870555a040d..4171613ba865bb3ba82a2e3a219def63bb7abdc1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1,14 +1,406 @@
@@ -284,7 +284,6 @@ index 1ed186b597eece7c34cb69c8e1e20870555a040d..2ce1e8a7dcca2ba153d387d11970c72b
+ ":node_js2c_exec",
+ "deps/googletest:gtest",
+ "deps/ada",
+ "deps/base64",
+ "deps/simdutf",
+ "deps/uvwasi",
+ "//third_party/zlib",
@@ -333,6 +332,7 @@ index 1ed186b597eece7c34cb69c8e1e20870555a040d..2ce1e8a7dcca2ba153d387d11970c72b
+ "-Wno-sometimes-uninitialized",
+ "-Wno-string-plus-int",
+ "-Wno-unused-function",
+ "-Wno-unreachable-code-return",
+ "-Wno-unused-label",
+ "-Wno-unused-private-field",
+ "-Wno-unused-variable",
@@ -458,84 +458,6 @@ index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec
-ada_gn_build("ada") {
+ public_configs = [ ":ada_config" ]
}
diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni
index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c76ca5c61c 100644
--- a/deps/base64/unofficial.gni
+++ b/deps/base64/unofficial.gni
@@ -12,6 +12,10 @@ template("base64_gn_build") {
}
}
+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure
+ # out why it does not work in Electron's build configs.
+ support_x86_asm = current_cpu == "x64" || (current_cpu == "x86" && !is_win)
+
config("base64_internal_config") {
include_dirs = [ "base64/lib" ]
if (is_component_build) {
@@ -19,7 +23,7 @@ template("base64_gn_build") {
} else {
defines = []
}
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
defines += [
"HAVE_SSSE3=1",
"HAVE_SSE41=1",
@@ -69,7 +73,7 @@ template("base64_gn_build") {
source_set("base64_ssse3") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/ssse3/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mssse3" ]
}
@@ -79,7 +83,7 @@ template("base64_gn_build") {
source_set("base64_sse41") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse41/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.1" ]
}
@@ -89,7 +93,7 @@ template("base64_gn_build") {
source_set("base64_sse42") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/sse42/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-msse4.2" ]
}
@@ -99,7 +103,7 @@ template("base64_gn_build") {
source_set("base64_avx") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx" ]
} else if (is_win) {
@@ -111,7 +115,7 @@ template("base64_gn_build") {
source_set("base64_avx2") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx2/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [ "-mavx2" ]
} else if (is_win) {
@@ -123,7 +127,7 @@ template("base64_gn_build") {
source_set("base64_avx512") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx512/codec.c" ]
- if (current_cpu == "x86" || current_cpu == "x64") {
+ if (support_x86_asm) {
if (is_clang || !is_win) {
cflags_c = [
"-mavx512vl",
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..ef745c19f2b1cd433cc43c834a18db7eaa8e5162 100644
--- a/deps/cares/BUILD.gn
@@ -1281,7 +1203,7 @@ index 0000000000000000000000000000000000000000..af9cbada10203b387fb9732b346583b1
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..c429d4cbfff605ff78c7c8ee3c5ad046594163f3
index 0000000000000000000000000000000000000000..72ddbe405908109ab7563e0c8f2e61c75cac88fc
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,740 @@
@@ -1649,6 +1571,7 @@ index 0000000000000000000000000000000000000000..c429d4cbfff605ff78c7c8ee3c5ad046
+ "lib/internal/source_map/prepare_stack_trace.js",
+ "lib/internal/source_map/source_map.js",
+ "lib/internal/source_map/source_map_cache.js",
+ "lib/internal/source_map/source_map_cache_map.js",
+ "lib/internal/stream_base_commons.js",
+ "lib/internal/streams/add-abort-signal.js",
+ "lib/internal/streams/compose.js",
@@ -1696,10 +1619,8 @@ index 0000000000000000000000000000000000000000..c429d4cbfff605ff78c7c8ee3c5ad046
+ "lib/internal/util/colors.js",
+ "lib/internal/util/comparisons.js",
+ "lib/internal/util/debuglog.js",
+ "lib/internal/util/embedding.js",
+ "lib/internal/util/inspect.js",
+ "lib/internal/util/inspector.js",
+ "lib/internal/util/iterable_weak_map.js",
+ "lib/internal/util/parse_args/parse_args.js",
+ "lib/internal/util/parse_args/utils.js",
+ "lib/internal/util/types.js",
@@ -1725,6 +1646,7 @@ index 0000000000000000000000000000000000000000..c429d4cbfff605ff78c7c8ee3c5ad046
+ "lib/internal/worker.js",
+ "lib/internal/worker/io.js",
+ "lib/internal/worker/js_transferable.js",
+ "lib/internal/worker/messaging.js",
+ "lib/module.js",
+ "lib/net.js",
+ "lib/os.js",

View File

@@ -10,7 +10,7 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8
This can be removed when Electron upgrades to a version of Node.js containing the required V8 version.
diff --git a/common.gypi b/common.gypi
index 690068f093f12b6831f8ccce41289d02d7047a7a..5a3df388773ad288553bf036be42dc1a0ba75c09 100644
index 3b26f0e9c8a16135d6c614374cfb943ebc07f992..4a79378a6633b33f86f6576c27659df18193ed46 100644
--- a/common.gypi
+++ b/common.gypi
@@ -305,7 +305,7 @@

View File

@@ -18,7 +18,7 @@ significant.
PR-URL: https://github.com/nodejs/node/pull/52794
diff --git a/common.gypi b/common.gypi
index 9bbf1b277eb17d78ca385643c3177638fd75866a..959ee74af88b44d31f2e6fa65c6f260820bd8c46 100644
index 2f0dab65717ac59a32bd91dbac6a0b9ded5c93e6..cd3700f5290e69ec60fc22bd5fa32b54565aa049 100644
--- a/common.gypi
+++ b/common.gypi
@@ -480,6 +480,10 @@

View File

@@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
diff --git a/common.gypi b/common.gypi
index 776a6dcf3a729a65b367fb5b4c5685f841089eea..690068f093f12b6831f8ccce41289d02d7047a7a 100644
index 46761b75327826b1f608670a1511be01df9be08e..3b26f0e9c8a16135d6c614374cfb943ebc07f992 100644
--- a/common.gypi
+++ b/common.gypi
@@ -86,6 +86,8 @@

View File

@@ -40,10 +40,10 @@ index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb751
}
if (is_clang || !is_win) {
diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni
index 7a73f891e3fc3261b77af97af63fca2eade49849..bda1b5dc899558c2b4a22377dde9fb3bcce5488c 100644
index 348d2f0703e47ca7c5326a4b4c1d6ae31157eeb5..0944d6ddd241b113970ab6aa5804f9534fde882a 100644
--- a/deps/uv/unofficial.gni
+++ b/deps/uv/unofficial.gni
@@ -82,11 +82,11 @@ template("uv_gn_build") {
@@ -87,11 +87,11 @@ template("uv_gn_build") {
]
}
if (is_posix) {

View File

@@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment
in which the binary got built.
diff --git a/common.gypi b/common.gypi
index 5a3df388773ad288553bf036be42dc1a0ba75c09..9bbf1b277eb17d78ca385643c3177638fd75866a 100644
index 4a79378a6633b33f86f6576c27659df18193ed46..2f0dab65717ac59a32bd91dbac6a0b9ded5c93e6 100644
--- a/common.gypi
+++ b/common.gypi
@@ -125,6 +125,7 @@

View File

@@ -15,20 +15,20 @@ This patch is expected to be deleted once we catch up with a Node.js
upgrade that includes the original Node.js commit above.
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index ff658ec88e5161cd66536ee6e95dba675b16eccc..9bbb8ab908d8d992abb43254860d51f57f56387b 100644
index 0f0b16fcdd8a97bba60faeff09300dd8102cf02c..094d12ffe99500af700a591f5cb33e7d7b247ed1 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -202,8 +202,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
}
Local<String> source_text = args[2].As<String>();
- ScriptOrigin origin(isolate,
- url,
+ ScriptOrigin origin(url,
line_offset,
column_offset,
true, // is cross origin
@@ -464,7 +463,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
@@ -304,8 +304,7 @@ MaybeLocal<Module> ModuleWrap::CompileSourceTextModule(
bool* cache_rejected) {
Isolate* isolate = realm->isolate();
EscapableHandleScope scope(isolate);
- ScriptOrigin origin(isolate,
- url,
+ ScriptOrigin origin(url,
line_offset,
column_offset,
true, // is cross origin
@@ -500,7 +499,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
ShouldNotAbortOnUncaughtScope no_abort_scope(realm->env());
TryCatchScope try_catch(realm->env());
@@ -36,6 +36,16 @@ index ff658ec88e5161cd66536ee6e95dba675b16eccc..9bbb8ab908d8d992abb43254860d51f5
bool timed_out = false;
bool received_signal = false;
@@ -1009,8 +1007,7 @@ void ModuleWrap::CreateRequiredModuleFacade(
ASSIGN_OR_RETURN_UNWRAP(&original, wrap);
// Use the same facade source and URL to hit the compilation cache.
- ScriptOrigin origin(isolate,
- env->required_module_facade_url_string(),
+ ScriptOrigin origin(env->required_module_facade_url_string(),
0, // line offset
0, // column offset
true, // is cross origin
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2..3e37aa8b0c9696cceb3f3cfab9721f38c74a2fba 100644
--- a/src/node_builtins.cc
@@ -50,36 +60,20 @@ index 4bf80aa6cc6385dc376fd0a3538efc27fe5bd0a2..3e37aa8b0c9696cceb3f3cfab9721f38
BuiltinCodeCacheData cached_data{};
{
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 6456d87d4202c013aafe071adbac06852b3ae2c1..28ba7dbe66a44a43c39e3d75edf0be9513bcf732 100644
index c8ccf38eaaeaccf3715b742e7e64cf7803dbb392..a3f70f6cba773d0a7a00aca96a1687c1e2ae38e6 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -877,16 +877,15 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -878,8 +878,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
host_defined_options->Set(
isolate, loader::HostDefinedOptions::kID, id_symbol);
- ScriptOrigin origin(isolate,
- filename,
- line_offset, // line offset
- column_offset, // column offset
- true, // is cross origin
- -1, // script id
- Local<Value>(), // source map URL
- false, // is opaque (?)
- false, // is WASM
- false, // is ES Module
+ ScriptOrigin origin(filename,
+ line_offset, // line offset
+ column_offset, // column offset
+ true, // is cross origin
+ -1, // script id
+ Local<Value>(), // source map URL
+ false, // is opaque (?)
+ false, // is WASM
+ false, // is ES Module
host_defined_options);
ScriptCompiler::Source source(code, origin, cached_data);
ScriptCompiler::CompileOptions compile_options =
@@ -998,7 +997,7 @@ MaybeLocal<Function> CompileFunction(Local<Context> context,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
@@ -999,7 +998,7 @@ MaybeLocal<Function> CompileFunction(Local<Context> context,
Local<String> filename,
Local<String> content,
std::vector<Local<String>>* parameters) {
@@ -88,7 +82,7 @@ index 6456d87d4202c013aafe071adbac06852b3ae2c1..28ba7dbe66a44a43c39e3d75edf0be95
ScriptCompiler::Source script_source(content, script_origin);
return ScriptCompiler::CompileFunction(context,
@@ -1108,7 +1107,6 @@ bool ContextifyScript::EvalMachine(Local<Context> context,
@@ -1109,7 +1108,6 @@ bool ContextifyScript::EvalMachine(Local<Context> context,
}
TryCatchScope try_catch(env);
@@ -96,73 +90,26 @@ index 6456d87d4202c013aafe071adbac06852b3ae2c1..28ba7dbe66a44a43c39e3d75edf0be95
ContextifyScript* wrapped_script;
ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.This(), false);
Local<UnboundScript> unbound_script =
@@ -1286,8 +1284,7 @@ void ContextifyContext::CompileFunction(
@@ -1278,8 +1276,7 @@ void ContextifyContext::CompileFunction(
Local<PrimitiveArray> host_defined_options =
GetHostDefinedOptions(isolate, id_symbol);
ScriptCompiler::Source source =
- GetCommonJSSourceInstance(isolate,
- code,
+ GetCommonJSSourceInstance(code,
filename,
line_offset,
column_offset,
@@ -1342,15 +1339,13 @@ void ContextifyContext::CompileFunction(
}
loader::ModuleWrap::GetHostDefinedOptions(isolate, id_symbol);
ScriptCompiler::Source ContextifyContext::GetCommonJSSourceInstance(
- Isolate* isolate,
Local<String> code,
Local<String> filename,
int line_offset,
int column_offset,
Local<PrimitiveArray> host_defined_options,
ScriptCompiler::CachedData* cached_data) {
- ScriptOrigin origin(isolate,
- filename,
+ ScriptOrigin origin(filename,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
@@ -1528,7 +1523,7 @@ void ContextifyContext::ContainsModuleSyntax(
Local<PrimitiveArray> host_defined_options =
GetHostDefinedOptions(isolate, id_symbol);
ScriptCompiler::Source source = GetCommonJSSourceInstance(
- isolate, code, filename, 0, 0, host_defined_options, nullptr);
+ code, filename, 0, 0, host_defined_options, nullptr);
ScriptCompiler::CompileOptions options = GetCompileOptions(source);
std::vector<Local<String>> params = GetCJSParameters(env->isolate_data());
@@ -1576,7 +1571,7 @@ void ContextifyContext::ContainsModuleSyntax(
code,
String::NewFromUtf8(isolate, "})();").ToLocalChecked());
ScriptCompiler::Source wrapped_source = GetCommonJSSourceInstance(
- isolate, code, filename, 0, 0, host_defined_options, nullptr);
+ code, filename, 0, 0, host_defined_options, nullptr);
std::ignore = ScriptCompiler::CompileFunction(
context,
&wrapped_source,
@@ -1629,8 +1624,7 @@ static void CompileFunctionForCJSLoader(
@@ -1466,8 +1463,7 @@ static MaybeLocal<Function> CompileFunctionForCJSLoader(
Local<Symbol> symbol = env->vm_dynamic_import_default_internal();
Local<PrimitiveArray> hdo = GetHostDefinedOptions(isolate, symbol);
Local<PrimitiveArray> hdo =
loader::ModuleWrap::GetHostDefinedOptions(isolate, symbol);
- ScriptOrigin origin(isolate,
- filename,
+ ScriptOrigin origin(filename,
0, // line offset
0, // column offset
true, // is cross origin
diff --git a/src/node_contextify.h b/src/node_contextify.h
index 517e3f44d324900222e1da961a4cd60bbb4a85f9..10715c7eb07715cc11e49734bd54747dad95f6a4 100644
--- a/src/node_contextify.h
+++ b/src/node_contextify.h
@@ -99,7 +99,6 @@ class ContextifyContext : public BaseObject {
v8::Local<v8::Symbol> id_symbol,
const errors::TryCatchScope& try_catch);
static v8::ScriptCompiler::Source GetCommonJSSourceInstance(
- v8::Isolate* isolate,
v8::Local<v8::String> code,
v8::Local<v8::String> filename,
int line_offset,
diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc
index 64e38c83006a004ebc3519a5e9f8b04263244514..14e82cc80ff73084fb43b2ef07febfd2667a0abc 100644
--- a/test/cctest/test_environment.cc

View File

@@ -8,23 +8,23 @@ they use themselves as the entry point. We should try to upstream some form
of this.
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 364469160af5e348f8890417de16a63c0d1dca67..75d5f58fe02fa8cfa7716ffaf761d567ab403a2c 100644
index 82a3b80f6ffe8bf484d00f7898572dbf27918461..6e2802ab497c1659dfbda081e1d190ea0a94b586 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1441,6 +1441,13 @@ Module.prototype._compile = function(content, filename, loadAsESM = false) {
if (getOptionValue('--inspect-brk') && process._eval == null) {
if (!resolvedArgv) {
// We enter the repl if we're not given a filename argument.
+ // process._firstFileName is used by Embedders to tell node what
+ // the first "real" file is when they use themselves as the entry
+ // point
+ if (process._firstFileName) {
+ resolvedArgv = process._firstFileName
+ delete process._firstFileName
+ } else
if (process.argv[1]) {
try {
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
@@ -1530,6 +1530,13 @@ Module.prototype._compile = function(content, filename, format) {
this[kIsExecuting] = true;
if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) {
const { callAndPauseOnStart } = internalBinding('inspector');
+ // process._firstFileName is used by Embedders to tell node what
+ // the first "real" file is when they use themselves as the entry
+ // point
+ if (process._firstFileName) {
+ resolvedArgv = process._firstFileName;
+ delete process._firstFileName;
+ }
result = callAndPauseOnStart(compiledWrapper, thisValue, exports,
require, module, filename, dirname,
process, localGlobal, localBuffer);
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index 0bbabb80c26a1208860f6d32447c0ae53316f501..ba18bfa3cd17c2b8e977f53651ce2744b17a829f 100644
--- a/lib/internal/process/pre_execution.js

View File

@@ -11,7 +11,7 @@ its own blended handler between Node and Blink.
Not upstreamable.
diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js
index 150816057129c147c13ce044474f341581679f34..dd8627653265e22f55e67ec4a47641b20fba6c9d 100644
index 38b5eaf1d7e0f2c006ceae9e6ac3edaa87d22838..d71b19f986653b37aed520584ab84e8003de972f 100644
--- a/lib/internal/modules/esm/utils.js
+++ b/lib/internal/modules/esm/utils.js
@@ -30,7 +30,7 @@ const {
@@ -23,7 +23,7 @@ index 150816057129c147c13ce044474f341581679f34..dd8627653265e22f55e67ec4a47641b2
const {
loadPreloadModules,
initializeFrozenIntrinsics,
@@ -273,12 +273,13 @@ let _forceDefaultLoader = false;
@@ -274,12 +274,13 @@ let _forceDefaultLoader = false;
* @param {boolean} [forceDefaultLoader=false] - A boolean indicating disabling custom loaders.
*/
function initializeESM(forceDefaultLoader = false) {
@@ -40,10 +40,10 @@ index 150816057129c147c13ce044474f341581679f34..dd8627653265e22f55e67ec4a47641b2
/**
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c3579780d7831c 100644
index c0776ffbbf0497d4675ae052b06682061e3aa27d..9a9b219352aa134cffa2b179b77dd948563c842b 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -752,7 +752,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
@@ -770,7 +770,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
return module->module_.Get(isolate);
}
@@ -52,7 +52,7 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797
Local<Context> context,
Local<v8::Data> host_defined_options,
Local<Value> resource_name,
@@ -817,12 +817,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
@@ -835,12 +835,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
Realm* realm = Realm::GetCurrent(args);
HandleScope handle_scope(isolate);
@@ -68,7 +68,7 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797
}
void ModuleWrap::HostInitializeImportMetaObjectCallback(
@@ -864,13 +865,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
@@ -882,13 +883,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
Realm* realm = Realm::GetCurrent(args);
Isolate* isolate = realm->isolate();
@@ -87,18 +87,18 @@ index eea74bed4bb8a980f99a9a1404c9a2df203ca09c..e862b51293135995c527c32aa3c35797
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
diff --git a/src/module_wrap.h b/src/module_wrap.h
index 45a338b38e01c824f69ea59ee286130c67e9eddf..99bb079df11696fc3ba5e6bcca7e7a42818fe3d1 100644
index 51b127209af695e9e4682f959b263e2c613d6243..78b2dd399a5c5eace5fba4713a5eacd2d636ab66 100644
--- a/src/module_wrap.h
+++ b/src/module_wrap.h
@@ -7,6 +7,7 @@
#include <string>
@@ -8,6 +8,7 @@
#include <unordered_map>
#include <vector>
#include "base_object.h"
+#include "node.h"
#include "v8-script.h"
namespace node {
@@ -31,7 +32,14 @@ enum HostDefinedOptions : int {
@@ -33,7 +34,14 @@ enum HostDefinedOptions : int {
kLength = 9,
};
@@ -114,20 +114,20 @@ index 45a338b38e01c824f69ea59ee286130c67e9eddf..99bb079df11696fc3ba5e6bcca7e7a42
public:
enum InternalFields {
kModuleSlot = BaseObject::kInternalFieldCount,
@@ -68,6 +76,8 @@ class ModuleWrap : public BaseObject {
return true;
}
@@ -90,6 +98,8 @@ class ModuleWrap : public BaseObject {
static void CreateRequiredModuleFacade(
const v8::FunctionCallbackInfo<v8::Value>& args);
+ static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
+
private:
ModuleWrap(Realm* realm,
v8::Local<v8::Object> object,
@@ -110,7 +120,6 @@ class ModuleWrap : public BaseObject {
@@ -128,7 +138,6 @@ class ModuleWrap : public BaseObject {
v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_attributes,
v8::Local<v8::Module> referrer);
- static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
v8::Global<v8::Module> module_;
std::unordered_map<std::string, v8::Global<v8::Promise>> resolve_cache_;
std::unordered_map<std::string, v8::Global<v8::Object>> resolve_cache_;

View File

@@ -24,12 +24,12 @@ index c028204481d44cb5f35ad98413022e7b07ce04b2..230c2378996c5d1ec18a9183ef138bbf
message: Use `const { Blob } = require('buffer');` instead of the global.
- name: BroadcastChannel
diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js
index cfd1d1b6f18e2943e155cf021b566a4673f71ab0..8d1a184ad1936c0d8493d6c54c32bebcf0021d8b 100644
index 54f92797323ef914f23b9cc9174de8bc46ffa7e5..1944fdbf5c7e81bff5a0818c9cac95ed5287a2e7 100644
--- a/lib/internal/main/worker_thread.js
+++ b/lib/internal/main/worker_thread.js
@@ -113,7 +113,7 @@ port.on('message', (message) => {
@@ -117,7 +117,7 @@ port.on('message', (message) => {
require('internal/worker').assignEnvironmentData(environmentData);
setupMainThreadPort(mainThreadPort);
- if (SharedArrayBuffer !== undefined && Atomics !== undefined) {
+ if (SharedArrayBuffer !== undefined) {
@@ -37,10 +37,10 @@ index cfd1d1b6f18e2943e155cf021b566a4673f71ab0..8d1a184ad1936c0d8493d6c54c32bebc
// not to workers created by other workers.
let cachedCwd = '';
diff --git a/lib/internal/worker.js b/lib/internal/worker.js
index 401bc43550ea7f19847dfd588e3fba0507243905..560f69c6c2de2bd976bcd62cd7ac9c770b838446 100644
index 519faa4ff765f63beda02f6081a4fbf181440053..a0d819bcbabdceba9b521d79c555c8314c10e303 100644
--- a/lib/internal/worker.js
+++ b/lib/internal/worker.js
@@ -101,8 +101,7 @@ let cwdCounter;
@@ -102,8 +102,7 @@ let cwdCounter;
const environmentData = new SafeMap();
// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.

View File

@@ -21,7 +21,7 @@ index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397
typedef void (*FreeCallback)(char* data, void* hint);
diff --git a/src/node_errors.h b/src/node_errors.h
index ac07b96b5cad0f3502468c86745e2b341d338e1f..f51c4309ceec3f0dc5e07982fb789ff6663076ba 100644
index d5e2f86f516bbb49fc2ed64076dcd436ea6433ac..c027da4fcf0aa31864fe75c567b2e1cec2a97136 100644
--- a/src/node_errors.h
+++ b/src/node_errors.h
@@ -235,7 +235,7 @@ inline v8::Local<v8::Object> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {

View File

@@ -68,7 +68,7 @@ index af23e674cb361ed81dafa22670d5633559cd1144..1dd59990cb7cdba8aecf4f499ee6b92e
+ await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 } }), 'exit');
})().then(common.mustCall());
diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs
index 84f20a77dda367fe1ada8d616c7b6813d39efd43..9bebb256776c5be155a8de07abbe4284bc8dad8a 100644
index 6f36dbeb15b869bf96bd8e9b80674bd1c2d12603..d62bfb574a37ce434afdbc2ae67ac3b5daa33dae 100644
--- a/test/parallel/test-node-output-errors.mjs
+++ b/test/parallel/test-node-output-errors.mjs
@@ -3,6 +3,7 @@ import * as fixtures from '../common/fixtures.mjs';

View File

@@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
diff --git a/doc/api/cli.md b/doc/api/cli.md
index df7031f65d44f9abfcf43281c0d153c654269b60..d0d78beed2b02a3703bd45fdaa4291600f98d35e 100644
index 85920e71be2cc5b9747181830e41d3249097f5bf..a4e9a7fb6a1d413190c79ea01de2c87da459538f 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -2886,7 +2886,6 @@ V8 options that are allowed are:
@@ -2920,7 +2920,6 @@ V8 options that are allowed are:
* `--disallow-code-generation-from-strings`
* `--enable-etw-stack-walking`
* `--expose-gc`
@@ -30,10 +30,10 @@ index df7031f65d44f9abfcf43281c0d153c654269b60..d0d78beed2b02a3703bd45fdaa429160
* `--jitless`
* `--max-old-space-size`
diff --git a/src/node_options.cc b/src/node_options.cc
index e19b9d88a908154dbcfd0b0e3efbc7510609f810..e056e43c36de885df57fb3d9f8d76f0bdc412537 100644
index a2fe006a201c946c8de336b8e2e86dabc5f5443b..f493285b4ce39e16565109f583f4383432c28b2c 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -870,11 +870,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
@@ -893,11 +893,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"disallow eval and friends",
V8Option{},
kAllowedInEnvvar);

View File

@@ -9,17 +9,16 @@ This patch can be removed when Electron upgrades to a version of Node.js that
contains the above CL.
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index e862b51293135995c527c32aa3c3579780d7831c..ff658ec88e5161cd66536ee6e95dba675b16eccc 100644
index 9a9b219352aa134cffa2b179b77dd948563c842b..0f0b16fcdd8a97bba60faeff09300dd8102cf02c 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -186,7 +186,9 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
@@ -197,7 +197,8 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) {
export_names[i] = export_name_val.As<String>();
}
- module = Module::CreateSyntheticModule(isolate, url, export_names,
+
+ module = Module::CreateSyntheticModule(isolate, url,
+ v8::MemorySpan<const Local<String>>(export_names.begin(), export_names.end()),
SyntheticModuleEvaluationStepsCallback);
} else {
ScriptCompiler::CachedData* cached_data = nullptr;
// When we are compiling for the default loader, this will be

View File

@@ -35,10 +35,10 @@ Reviewed-By: James M Snell <jasnell@gmail.com>
(cherry picked from commit 8fd90938f923ef2a04bb3ebb08b89568fe6fd4ee)
diff --git a/src/node.cc b/src/node.cc
index 1fc236d88e53ebe2fd388b9799c0e857d8b4e88e..751d818308ee499a1201e5972ec80f12ed998114 100644
index 4ad2c8b80493aa3e74dc247701dfb36542fac72a..a60c3504029d4e1566fd1905991719700260997a 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -782,12 +782,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
@@ -790,12 +790,6 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
return ExitCode::kInvalidCommandLineArgument2;
}

View File

@@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi
index 04852d81103ef83c5213464f543839dea6f0b181..776a6dcf3a729a65b367fb5b4c5685f841089eea 100644
index d3c17d47bc141b201b741fd0b2e26d096c48ec35..46761b75327826b1f608670a1511be01df9be08e 100644
--- a/common.gypi
+++ b/common.gypi
@@ -88,6 +88,23 @@

View File

@@ -13,10 +13,10 @@ CL: https://chromium-review.googlesource.com/c/v8/v8/+/5630388
This patch can be removed when the node change is incorporated into main.
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465e11439b8 100644
index a3f70f6cba773d0a7a00aca96a1687c1e2ae38e6..9f38cdf60f36dbd32007ee2536b13e71b265989d 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -49,6 +49,7 @@ using v8::FunctionTemplate;
@@ -51,6 +51,7 @@ using v8::FunctionTemplate;
using v8::HandleScope;
using v8::IndexedPropertyHandlerConfiguration;
using v8::Int32;
@@ -24,7 +24,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
using v8::Isolate;
using v8::Just;
using v8::Local;
@@ -484,14 +485,15 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
@@ -485,14 +486,15 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
}
// static
@@ -44,7 +44,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
Local<Context> context = ctx->context();
Local<Object> sandbox = ctx->sandbox();
@@ -515,18 +517,22 @@ void ContextifyContext::PropertyGetterCallback(
@@ -516,18 +518,22 @@ void ContextifyContext::PropertyGetterCallback(
rv = ctx->global_proxy();
args.GetReturnValue().Set(rv);
@@ -70,7 +70,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
Local<Context> context = ctx->context();
PropertyAttribute attributes = PropertyAttribute::None;
@@ -544,8 +550,9 @@ void ContextifyContext::PropertySetterCallback(
@@ -545,8 +551,9 @@ void ContextifyContext::PropertySetterCallback(
(static_cast<int>(attributes) &
static_cast<int>(PropertyAttribute::ReadOnly));
@@ -82,7 +82,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
// true for x = 5
// false for this.x = 5
@@ -564,11 +571,16 @@ void ContextifyContext::PropertySetterCallback(
@@ -565,11 +572,16 @@ void ContextifyContext::PropertySetterCallback(
bool is_declared = is_declared_on_global_proxy || is_declared_on_sandbox;
if (!is_declared && args.ShouldThrowOnError() && is_contextual_store &&
@@ -103,7 +103,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
Local<Value> desc;
if (is_declared_on_sandbox &&
@@ -582,19 +594,23 @@ void ContextifyContext::PropertySetterCallback(
@@ -583,19 +595,23 @@ void ContextifyContext::PropertySetterCallback(
// We have to specify the return value for any contextual or get/set
// property
if (desc_obj->HasOwnProperty(context, env->get_string()).FromMaybe(false) ||
@@ -132,7 +132,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
Local<Context> context = ctx->context();
@@ -604,19 +620,23 @@ void ContextifyContext::PropertyDescriptorCallback(
@@ -605,19 +621,23 @@ void ContextifyContext::PropertyDescriptorCallback(
Local<Value> desc;
if (sandbox->GetOwnPropertyDescriptor(context, property).ToLocal(&desc)) {
args.GetReturnValue().Set(desc);
@@ -159,7 +159,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
Local<Context> context = ctx->context();
Isolate* isolate = context->GetIsolate();
@@ -635,7 +655,7 @@ void ContextifyContext::PropertyDefinerCallback(
@@ -636,7 +656,7 @@ void ContextifyContext::PropertyDefinerCallback(
// If the property is set on the global as neither writable nor
// configurable, don't change it on the global or sandbox.
if (is_declared && read_only && dont_delete) {
@@ -168,7 +168,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
}
Local<Object> sandbox = ctx->sandbox();
@@ -658,6 +678,9 @@ void ContextifyContext::PropertyDefinerCallback(
@@ -659,6 +679,9 @@ void ContextifyContext::PropertyDefinerCallback(
desc.has_set() ? desc.set() : Undefined(isolate).As<Value>());
define_prop_on_sandbox(&desc_for_sandbox);
@@ -178,7 +178,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
} else {
Local<Value> value =
desc.has_value() ? desc.value() : Undefined(isolate).As<Value>();
@@ -669,26 +692,32 @@ void ContextifyContext::PropertyDefinerCallback(
@@ -670,26 +693,32 @@ void ContextifyContext::PropertyDefinerCallback(
PropertyDescriptor desc_for_sandbox(value);
define_prop_on_sandbox(&desc_for_sandbox);
}
@@ -217,7 +217,7 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
}
// static
@@ -708,76 +737,84 @@ void ContextifyContext::PropertyEnumeratorCallback(
@@ -709,76 +738,84 @@ void ContextifyContext::PropertyEnumeratorCallback(
}
// static
@@ -328,11 +328,11 @@ index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465
void ContextifyScript::CreatePerIsolateProperties(
diff --git a/src/node_contextify.h b/src/node_contextify.h
index 10715c7eb07715cc11e49734bd54747dad95f6a4..49b9fabb399aed962e0d29e784a25ca4e9780a8f 100644
index 88b5684844b915325b28a37b7357a02231cd119e..eac9ac311f04bfe037ac07c560f08e136707c713 100644
--- a/src/node_contextify.h
+++ b/src/node_contextify.h
@@ -111,42 +111,39 @@ class ContextifyContext : public BaseObject {
const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -100,42 +100,39 @@ class ContextifyContext : public BaseObject {
const errors::TryCatchScope& try_catch);
static void WeakCallback(
const v8::WeakCallbackInfo<ContextifyContext>& data);
- static void PropertyGetterCallback(

View File

@@ -58,10 +58,10 @@ index 66d0a75e90dd11d5d96a738c01939dc1f5703dde..c101c0f314575b489e9ee93281a56b87
}
diff --git a/src/node_options.cc b/src/node_options.cc
index b7ef44b018c7aec59d8311642a811d1280247689..e19b9d88a908154dbcfd0b0e3efbc7510609f810 100644
index 7a937d4b6559fe9d616f9540591f69610fa5d9d7..a2fe006a201c946c8de336b8e2e86dabc5f5443b 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -1409,14 +1409,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
@@ -1432,14 +1432,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
}
Isolate* isolate = args.GetIsolate();

View File

@@ -24,10 +24,10 @@ index be02d4aaa04685cbd6a9ecfe082e38f179129ab5..277748a30bd97ae816d9ba1f2d73851a
wrap->object()->Has(env->context(), env->handle_onclose_symbol())
.FromMaybe(false)) {
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 8951cd378a9025f58fada47cf96f686d14639f95..6456d87d4202c013aafe071adbac06852b3ae2c1 100644
index 7f82bca746408ba718f3b5416392ff336d458aa1..c8ccf38eaaeaccf3715b742e7e64cf7803dbb392 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -487,6 +487,7 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
@@ -488,6 +488,7 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
void ContextifyContext::PropertyGetterCallback(
Local<Name> property,
const PropertyCallbackInfo<Value>& args) {
@@ -35,7 +35,7 @@ index 8951cd378a9025f58fada47cf96f686d14639f95..6456d87d4202c013aafe071adbac0685
ContextifyContext* ctx = ContextifyContext::Get(args);
// Still initializing
@@ -494,6 +495,8 @@ void ContextifyContext::PropertyGetterCallback(
@@ -495,6 +496,8 @@ void ContextifyContext::PropertyGetterCallback(
Local<Context> context = ctx->context();
Local<Object> sandbox = ctx->sandbox();
@@ -44,7 +44,7 @@ index 8951cd378a9025f58fada47cf96f686d14639f95..6456d87d4202c013aafe071adbac0685
MaybeLocal<Value> maybe_rv =
sandbox->GetRealNamedProperty(context, property);
if (maybe_rv.IsEmpty()) {
@@ -503,6 +506,11 @@ void ContextifyContext::PropertyGetterCallback(
@@ -504,6 +507,11 @@ void ContextifyContext::PropertyGetterCallback(
Local<Value> rv;
if (maybe_rv.ToLocal(&rv)) {

View File

@@ -453,18 +453,18 @@ index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf2187
s.pipe(h).on('data', common.mustCall(function(c) {
assert.strictEqual(c, expect);
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
index af2146982c7a3bf7bd7527f44e4b17a3b605026e..f6b91f675cfea367c608892dee078b565814f2dd 100644
index 8a946ac55adb00ccd6c7cdeb020e6aa137e1be8a..66d5b10f5fdd8e831793e208b7117dff5064e8d1 100644
--- a/test/parallel/test-crypto-hash.js
+++ b/test/parallel/test-crypto-hash.js
@@ -182,6 +182,7 @@ assert.throws(
@@ -183,6 +183,7 @@ assert.throws(
// Test XOF hash functions and the outputLength option.
{
+ /*
// Default outputLengths.
assert.strictEqual(crypto.createHash('shake128').digest('hex'),
'7f9c2ba4e88f827d616045507605853e');
@@ -236,6 +237,7 @@ assert.throws(
// Default outputLengths. Since OpenSSL 3.4 an outputLength is mandatory
if (!hasOpenSSL(3, 4)) {
assert.strictEqual(crypto.createHash('shake128').digest('hex'),
@@ -239,6 +240,7 @@ assert.throws(
assert.strictEqual(superLongHash.length, 2 * 1024 * 1024);
assert.ok(superLongHash.endsWith('193414035ddba77bf7bba97981e656ec'));
assert.ok(superLongHash.startsWith('a2a28dbc49cfd6e5d6ceea3d03e77748'));

View File

@@ -6,10 +6,10 @@ Subject: fix: do not resolve electron entrypoints
This wastes fs cycles and can result in strange behavior if this path actually exists on disk
diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js
index 22248b753c14960122f1d6b9bfe6b89fdb8d2010..9d245a04fbcb98dcd1c61e60f7cfe528bd1c8af0 100644
index 41daab801d67689b50cc5e10a0e167701da301f8..227d31d19317ec94348c67029b407b3e534ab1b6 100644
--- a/lib/internal/modules/esm/load.js
+++ b/lib/internal/modules/esm/load.js
@@ -132,7 +132,7 @@ async function defaultLoad(url, context = kEmptyObject) {
@@ -134,7 +134,7 @@ async function defaultLoad(url, context = kEmptyObject) {
source = null;
format ??= 'builtin';
} else if (format !== 'commonjs' || defaultType === 'module') {
@@ -19,10 +19,10 @@ index 22248b753c14960122f1d6b9bfe6b89fdb8d2010..9d245a04fbcb98dcd1c61e60f7cfe528
context = { __proto__: context, source };
}
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 9c9b403774e51e2f7e1201ad53e60e98fc3b26e8..477a3b2cf61fcaa154f01ac77c8047ef548ac1f8 100644
index 27cf7d0ae4a9e07897f8b1faef2884aec29d3975..6943c7973b4ae5246f4b019331c45aa9619eb017 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -375,6 +375,9 @@ function cjsPreparseModuleExports(filename, source) {
@@ -322,6 +322,9 @@ function cjsPreparseModuleExports(filename, source) {
if (module && module[kModuleExportNames] !== undefined) {
return { module, exportNames: module[kModuleExportNames] };
}
@@ -33,7 +33,7 @@ index 9c9b403774e51e2f7e1201ad53e60e98fc3b26e8..477a3b2cf61fcaa154f01ac77c8047ef
if (!loaded) {
module = new CJSModule(filename);
diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js
index 4ad694debfc72f56dd98a4e56dd0bbc63711242e..73f0e00ad34132e7d2fd37ec321110881e89617f 100644
index a22bddf635f5e6270554ac87f11f4e12f540a84c..b0543b4ca1ddcf289d9c4162e6641f0b4af8b7bd 100644
--- a/lib/internal/modules/run_main.js
+++ b/lib/internal/modules/run_main.js
@@ -2,6 +2,7 @@
@@ -43,8 +43,8 @@ index 4ad694debfc72f56dd98a4e56dd0bbc63711242e..73f0e00ad34132e7d2fd37ec32111088
+ StringPrototypeStartsWith,
} = primordials;
const { containsModuleSyntax } = internalBinding('contextify');
@@ -22,6 +23,13 @@ const {
const { getOptionValue } = require('internal/options');
@@ -21,6 +22,13 @@ const {
* @param {string} main - Entry point path
*/
function resolveMainPath(main) {
@@ -58,7 +58,7 @@ index 4ad694debfc72f56dd98a4e56dd0bbc63711242e..73f0e00ad34132e7d2fd37ec32111088
const defaultType = getOptionValue('--experimental-default-type');
/** @type {string} */
let mainPath;
@@ -58,6 +66,13 @@ function resolveMainPath(main) {
@@ -57,6 +65,13 @@ function resolveMainPath(main) {
* @param {string} mainPath - Absolute path to the main entry point
*/
function shouldUseESMLoader(mainPath) {

View File

@@ -6,10 +6,10 @@ Subject: fix: expose the built-in electron module via the ESM loader
This allows usage of `import { app } from 'electron'` and `import('electron')` natively in the browser + non-sandboxed renderer
diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js
index 1fe5564545dbc86d7f2968274a25ee1579bcbf28..b876af21a0e97ae06dc344d9f78c8f5c7e403d43 100644
index fe7528e32a497c4ab8a08ac80f774576ec41b8ee..d01878eab8a2e1b353f861081e6ed8d4f11e6ffb 100644
--- a/lib/internal/modules/esm/get_format.js
+++ b/lib/internal/modules/esm/get_format.js
@@ -31,6 +31,7 @@ const protocolHandlers = {
@@ -32,6 +32,7 @@ const protocolHandlers = {
'http:': getHttpProtocolModuleFormat,
'https:': getHttpProtocolModuleFormat,
'node:'() { return 'builtin'; },
@@ -18,10 +18,10 @@ index 1fe5564545dbc86d7f2968274a25ee1579bcbf28..b876af21a0e97ae06dc344d9f78c8f5c
/**
diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js
index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7 100644
index d5004f4495bacc5d231a84f340ecd389940a7ef7..7beac5f7b3ec96577e4fd3056e3a72456167a11d 100644
--- a/lib/internal/modules/esm/load.js
+++ b/lib/internal/modules/esm/load.js
@@ -142,7 +142,7 @@ async function defaultLoad(url, context = kEmptyObject) {
@@ -144,7 +144,7 @@ async function defaultLoad(url, context = kEmptyObject) {
// Now that we have the source for the module, run `defaultGetFormat` to detect its format.
format = await defaultGetFormat(urlInstance, context);
@@ -30,7 +30,7 @@ index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe
// For backward compatibility reasons, we need to discard the source in
// order for the CJS loader to re-fetch it.
source = null;
@@ -234,6 +234,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
@@ -226,6 +226,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
protocol !== 'file:' &&
protocol !== 'data:' &&
protocol !== 'node:' &&
@@ -38,7 +38,7 @@ index 7b77af35a1dfebf6ad45ace521f1a55b5fa18293..ac24cf305bd5995ad13b37ee36f9e1fe
(
!experimentalNetworkImports ||
(
@@ -242,7 +243,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
@@ -234,7 +235,7 @@ function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
)
)
) {
@@ -73,10 +73,10 @@ index 93c7a040fd47f050b10b949e4f619d85660110c8..77b85490b1a65b594bb140deb07b33f3
parsePackageName(specifier, base);
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 044d820161a5f9809dd042be7e53b717de8678ab..5281d7c220c8adee0f3d7269a0116d082726ec91 100644
index 23c14e2ec6c85e36d7973a9918987127e3a08aee..0be9253a005790d9b106d456638a11a8499f9664 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -272,7 +272,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
@@ -226,7 +226,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
const { exportNames, module } = cjsPreparseModuleExports(filename, source);
cjsCache.set(url, module);
@@ -85,7 +85,7 @@ index 044d820161a5f9809dd042be7e53b717de8678ab..5281d7c220c8adee0f3d7269a0116d08
[...exportNames] : ['default', ...exportNames];
if (isMain) {
@@ -294,8 +294,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
@@ -248,8 +248,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) {
({ exports } = module);
}
for (const exportName of exportNames) {
@@ -96,7 +96,7 @@ index 044d820161a5f9809dd042be7e53b717de8678ab..5281d7c220c8adee0f3d7269a0116d08
continue;
}
// We might trigger a getter -> dont fail.
@@ -329,6 +329,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
@@ -283,6 +283,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
return createCJSModuleWrap(url, source);
});
@@ -106,9 +106,9 @@ index 044d820161a5f9809dd042be7e53b717de8678ab..5281d7c220c8adee0f3d7269a0116d08
+
// Handle CommonJS modules referenced by `import` statements or expressions,
// or as the initial entry point when the ESM loader handles a CommonJS entry.
translators.set('commonjs', async function commonjsStrategy(url, source,
translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
diff --git a/lib/internal/url.js b/lib/internal/url.js
index 42debfc20005b0d293e5507546dcd8caec2b6a4e..4b6d07b14bd92ac527b7f4bd55ff7005967cee7d 100644
index 91976bceb0db19adceaad566a05eb5ea29e7d3bc..4fdecccdde5174f516e6077ccad71584d4b91717 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -1485,6 +1485,8 @@ function fileURLToPath(path, options = kEmptyObject) {

View File

@@ -109,7 +109,7 @@ index 85d48dfd2c15c453707bf6eb94e22f89b4f856b2..fe31a9a7f465a03d2de365cef392dfbb
crypto::EVPKeyPointer key(raw_key);
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
index cef0c877c67643d47da787eddb95ed5a410a941b..1b8af49a48f1a34a92d4f0b502d435f3a4ab5d8e 100644
index dab6cf87a0809fe10db3a7c9664815d8dc091c2d..ad0652fa775373142301e1564c33fa52c3be7ad6 100644
--- a/src/crypto/crypto_context.cc
+++ b/src/crypto/crypto_context.cc
@@ -63,7 +63,7 @@ inline X509_STORE* GetOrCreateRootCertStore() {
@@ -121,7 +121,7 @@ index cef0c877c67643d47da787eddb95ed5a410a941b..1b8af49a48f1a34a92d4f0b502d435f3
if (!bio) return nullptr;
ByteSource bsrc = ByteSource::FromStringOrBuffer(env, v);
if (bsrc.size() > INT_MAX) return nullptr;
@@ -882,10 +882,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
@@ -883,10 +883,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
// If the user specified "auto" for dhparams, the JavaScript layer will pass
// true to this function instead of the original string. Any other string
// value will be interpreted as custom DH parameters below.
@@ -353,7 +353,7 @@ index 990638ec3993bde40ad3dd40d373d816ebc66a6a..63d971e1fe6b861e29c12f04563701b0
} // namespace
diff --git a/src/env.h b/src/env.h
index 2ec0a56e05ff879df8c55bf140677e571a56fafa..a30c25a3a61dfe73944731760404c555f2782d72 100644
index 598082f68aefe29fc31beeb70167225e8b3cf25e..d5eb12ebaeaf95c57e91261151aeb382c7620afd 100644
--- a/src/env.h
+++ b/src/env.h
@@ -49,7 +49,7 @@
@@ -375,7 +375,7 @@ index 2ec0a56e05ff879df8c55bf140677e571a56fafa..a30c25a3a61dfe73944731760404c555
// We declare another alias here to avoid having to include crypto_util.h
using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
diff --git a/src/node_metadata.h b/src/node_metadata.h
index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f14446099 100644
index 3628a9d04aa65f637cda27763d39dc4b16a939a3..b53f24c74d9c5de9bd716c441941aaac0bd703b6 100644
--- a/src/node_metadata.h
+++ b/src/node_metadata.h
@@ -6,7 +6,7 @@
@@ -388,7 +388,7 @@ index cf051585e779e2b03bd7b95fe5008b89cc7f8162..9de49c6828468fdf846dcd4ad445390f
#if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc
index f6ff810953b224b7e343d91e1065d95bc3e78d39..b7ef44b018c7aec59d8311642a811d1280247689 100644
index 9d5accc3ebc4165f23f8cd0373c061df24ce49a6..7a937d4b6559fe9d616f9540591f69610fa5d9d7 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -6,7 +6,7 @@
@@ -401,7 +401,7 @@ index f6ff810953b224b7e343d91e1065d95bc3e78d39..b7ef44b018c7aec59d8311642a811d12
#endif
diff --git a/src/node_options.h b/src/node_options.h
index 10c220f66122336215f25b9674acfdfe6df82a8e..e8b2243d24fe95ff31254071133fb646e186c07e 100644
index f7a5654a5cfcaa053a2f0e46a1dfc346e998f0b3..9bb0375cede24811b2190a775f49a56ecbe29933 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -11,7 +11,7 @@

View File

@@ -6,10 +6,10 @@ Subject: fix: lazyload fs in esm loaders to apply asar patches
Changes { foo } from fs to just "fs.foo" so that our patching of fs is applied to esm loaders
diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js
index ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7..22248b753c14960122f1d6b9bfe6b89fdb8d2010 100644
index 7beac5f7b3ec96577e4fd3056e3a72456167a11d..41daab801d67689b50cc5e10a0e167701da301f8 100644
--- a/lib/internal/modules/esm/load.js
+++ b/lib/internal/modules/esm/load.js
@@ -10,7 +10,7 @@ const { kEmptyObject } = require('internal/util');
@@ -12,7 +12,7 @@ const {
const { defaultGetFormat } = require('internal/modules/esm/get_format');
const { validateAttributes, emitImportAssertionWarning } = require('internal/modules/esm/assert');
const { getOptionValue } = require('internal/options');
@@ -18,7 +18,7 @@ index ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7..22248b753c14960122f1d6b9bfe6b89f
// Do not eagerly grab .manifest, it may be in TDZ
const policy = getOptionValue('--experimental-policy') ?
@@ -42,8 +42,7 @@ async function getSource(url, context) {
@@ -44,8 +44,7 @@ async function getSource(url, context) {
let responseURL = href;
let source;
if (protocol === 'file:') {
@@ -28,7 +28,7 @@ index ac24cf305bd5995ad13b37ee36f9e1fe3589c5d7..22248b753c14960122f1d6b9bfe6b89f
} else if (protocol === 'data:') {
const match = RegExpPrototypeExec(DATA_URL_PATTERN, url.pathname);
if (!match) {
@@ -82,7 +81,7 @@ function getSourceSync(url, context) {
@@ -84,7 +83,7 @@ function getSourceSync(url, context) {
const responseURL = href;
let source;
if (protocol === 'file:') {
@@ -78,10 +78,10 @@ index 77b85490b1a65b594bb140deb07b33f3accc9736..da99cc2d4ca930222ca018ddf42ee2e5
// Check for !stat.isDirectory()
if (stat !== 1) {
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index 5281d7c220c8adee0f3d7269a0116d082726ec91..9c9b403774e51e2f7e1201ad53e60e98fc3b26e8 100644
index 0be9253a005790d9b106d456638a11a8499f9664..27cf7d0ae4a9e07897f8b1faef2884aec29d3975 100644
--- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js
@@ -36,7 +36,7 @@ const {
@@ -33,7 +33,7 @@ const {
const { BuiltinModule } = require('internal/bootstrap/realm');
const assert = require('internal/assert');
@@ -90,7 +90,7 @@ index 5281d7c220c8adee0f3d7269a0116d082726ec91..9c9b403774e51e2f7e1201ad53e60e98
const { dirname, extname, isAbsolute } = require('path');
const {
loadBuiltinModule,
@@ -356,7 +356,7 @@ translators.set('commonjs', async function commonjsStrategy(url, source,
@@ -304,7 +304,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
try {
// We still need to read the FS to detect the exports.
@@ -99,7 +99,7 @@ index 5281d7c220c8adee0f3d7269a0116d082726ec91..9c9b403774e51e2f7e1201ad53e60e98
} catch {
// Continue regardless of error.
}
@@ -424,7 +424,7 @@ function cjsPreparseModuleExports(filename, source) {
@@ -371,7 +371,7 @@ function cjsPreparseModuleExports(filename, source) {
isAbsolute(resolved)) {
// TODO: this should be calling the `load` hook chain to get the source
// (and fallback to reading the FS only if the source is nullish).

View File

@@ -86,10 +86,10 @@ index 149c7c107322919dfeea1dfe89dc223f78b0e979..e4e8dac6b8b5924a7eae83935031e091
NODE_DEFINE_CONSTANT(target, ETIMEDOUT);
#endif
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a139051cc 100644
index 52c0179845fdad1b605e372d9ad132f2355b162d..12c20ba1bebc22b34950f6d016a9e1f20c822044 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -855,10 +855,6 @@ const char* errno_string(int errorno) {
@@ -860,10 +860,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOBUFS);
#endif
@@ -100,7 +100,7 @@ index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a
#ifdef ENODEV
ERRNO_CASE(ENODEV);
#endif
@@ -897,14 +893,6 @@ const char* errno_string(int errorno) {
@@ -902,14 +898,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOSPC);
#endif
@@ -115,7 +115,7 @@ index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a
#ifdef ENOSYS
ERRNO_CASE(ENOSYS);
#endif
@@ -987,10 +975,6 @@ const char* errno_string(int errorno) {
@@ -992,10 +980,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ESTALE);
#endif

View File

@@ -142,7 +142,7 @@ index da99cc2d4ca930222ca018ddf42ee2e5f898576a..34631a1f4ffea33ba520874e6571054d
const encodedSepRegEx = /%2F|%5C/i;
diff --git a/src/node_file.cc b/src/node_file.cc
index 73ad5a1a2c092d7f8dac84585fb9b13e76e84e13..039f693de14bec248f93262ad70f2736c24827e3 100644
index 39a70311f4ad212ee855d73f45232d3f21250ef4..9fd1fb88cd528a68c0cc85db972df4b948108e63 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -19,14 +19,11 @@

View File

@@ -6,10 +6,10 @@ 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 c284b39b1ac13eaea8776b7b4f457c084dce5fb8..c794751ecd4448119ce33d661e694f83b3323f03 100644
index ebccdb28256314e7cd8ac8d7e3dec670286022d2..7b5958ef2c32101629d800991ff0ad32fe5c5695 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -185,6 +185,13 @@ const {
@@ -188,6 +188,13 @@ const {
CHAR_FORWARD_SLASH,
} = require('internal/constants');
@@ -23,18 +23,18 @@ index c284b39b1ac13eaea8776b7b4f457c084dce5fb8..c794751ecd4448119ce33d661e694f83
const {
isProxy,
} = require('internal/util/types');
@@ -1464,10 +1471,12 @@ Module.prototype._compile = function(content, filename, loadAsESM = false) {
this[kIsExecuting] = true;
if (inspectorWrapper) {
result = inspectorWrapper(compiledWrapper, thisValue, exports,
- require, module, filename, dirname);
+ require, module, filename, dirname,
+ process, localGlobal, localBuffer);
@@ -1524,10 +1531,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]);
+ [exports, require, module, filename, dirname,
+ process, localGlobal, localBuffer]);
}
this[kIsExecuting] = false;
if (requireDepth === 0) { statCache = null; }

View File

@@ -7,7 +7,7 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were
a real filesystem.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f930f1c388 100644
index 2b12f9fb2966de350432ae63e411c88774a026a4..deb3decfe03925762228d689be20dbd6ebdb975b 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -134,6 +134,10 @@ process.domain = null;
@@ -22,10 +22,10 @@ index 12262f40ce123440a9a0f974386cfbe8511f4459..f3c15b61d33bdae44de528e106fcc6f9
const binding = internalBinding('builtins');
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index c794751ecd4448119ce33d661e694f83b3323f03..364469160af5e348f8890417de16a63c0d1dca67 100644
index 7b5958ef2c32101629d800991ff0ad32fe5c5695..82a3b80f6ffe8bf484d00f7898572dbf27918461 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -138,7 +138,7 @@ const {
@@ -141,7 +141,7 @@ const {
const assert = require('internal/assert');
const fs = require('fs');
const path = require('path');
@@ -34,7 +34,7 @@ index c794751ecd4448119ce33d661e694f83b3323f03..364469160af5e348f8890417de16a63c
const { safeGetenv } = internalBinding('credentials');
const {
privateSymbols: {
@@ -233,7 +233,7 @@ function stat(filename) {
@@ -236,7 +236,7 @@ function stat(filename) {
const result = statCache.get(filename);
if (result !== undefined) { return result; }
}

View File

@@ -146,7 +146,7 @@ index ca75e0360bbf6a20ea18e67dda167d5ec523b075..158b96a9b1ea5553fa74d2429152a5c9
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
diff --git a/src/env.h b/src/env.h
index a30c25a3a61dfe73944731760404c555f2782d72..6137551bb8168d8fa9a3e6bc79c3d1e79b306931 100644
index d5eb12ebaeaf95c57e91261151aeb382c7620afd..aea955e490ede3cba37eb1b484b1f3323aa4a1f6 100644
--- a/src/env.h
+++ b/src/env.h
@@ -174,10 +174,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {

View File

@@ -6,10 +6,10 @@ Subject: src: use supported API to get stalled TLA messages
Refs: https://github.com/v8/v8/commit/23e3b6f650162ed2b332e55aa802adb8f41b50f2
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 9bbb8ab908d8d992abb43254860d51f57f56387b..92edfc6fc6401edd3685a0137eac25d9e37566f6 100644
index 094d12ffe99500af700a591f5cb33e7d7b247ed1..0b88c84601a32181deb3245edb9c4a93e47e8222 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -587,11 +587,10 @@ void ModuleWrap::EvaluateSync(const FunctionCallbackInfo<Value>& args) {
@@ -635,11 +635,10 @@ void ModuleWrap::EvaluateSync(const FunctionCallbackInfo<Value>& args) {
if (module->IsGraphAsync()) {
CHECK(env->options()->print_required_tla);

View File

@@ -28,7 +28,7 @@ index a7860449225092529e1a262aed3f30fb21212e9d..1a55ea53c602b3fede260fffc173dfab
test-net-write-fully-async-hex-string: PASS, FLAKY
# https://github.com/nodejs/node/issues/52273
diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status
index dd2275ddc9540464d838476f998cea683d5ceccc..796e3c56174d9cd2b9d3969150d9605b32c46f0b 100644
index a3199b385dd99de57ac0fc25b1b3ecfebfcb5e61..725457846899583698ae37a8ba6088c694b09053 100644
--- a/test/sequential/sequential.status
+++ b/test/sequential/sequential.status
@@ -7,6 +7,18 @@ prefix sequential

View File

@@ -0,0 +1,84 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 1 Apr 2025 09:16:56 +0000
Subject: test: make eval snapshot tests more flexible
Upstreamed in https://github.com/nodejs/node/pull/57020
diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot
index 6a37ad2263461796c2c6a55f21b35b49302021b4..d844c4a4dacf73259a864f4fd8dc9df072046452 100644
--- a/test/fixtures/eval/eval_messages.snapshot
+++ b/test/fixtures/eval/eval_messages.snapshot
@@ -62,7 +62,7 @@ Node.js *
var ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
@@ -70,7 +70,7 @@ Node.js *
var ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
done
diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot
index 3c03bd64072061bd78b0424becc0f2ce960ca34b..89f2cd87b31b16d698e06cc5da18b17f7fd153e9 100644
--- a/test/fixtures/eval/stdin_messages.snapshot
+++ b/test/fixtures/eval/stdin_messages.snapshot
@@ -75,7 +75,7 @@ Node.js *
let ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
@@ -83,7 +83,7 @@ Node.js *
let ______________________________________________; throw 10
^
10
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *
done
diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs
index 2fa60206e1ea1c1ba14ea2b6822e06e36bb856f9..2be134747842da25795cab50adb5d1956abda1eb 100644
--- a/test/parallel/test-node-output-eval.mjs
+++ b/test/parallel/test-node-output-eval.mjs
@@ -1,6 +1,7 @@
import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
+import { basename } from 'node:path';
import { describe, it } from 'node:test';
describe('eval output', { concurrency: true }, () => {
@@ -14,13 +15,19 @@ describe('eval output', { concurrency: true }, () => {
normalize,
snapshot.replaceWindowsLineEndings,
snapshot.replaceWindowsPaths,
- snapshot.replaceNodeVersion
+ snapshot.replaceNodeVersion,
+ generalizeProcessName,
);
function removeStackTraces(output) {
return output.replaceAll(/^ *at .+$/gm, '');
}
+ function generalizeProcessName(output) {
+ const baseName = basename(process.argv0 || 'node', '.exe');
+ return output.replaceAll(`${baseName} --`, '* --');
+ }
+
const tests = [
{ name: 'eval/eval_messages.js' },
{ name: 'eval/stdin_messages.js' },