Skip to content

Commit 8647ef3

Browse files
chore: bump node to v22.21.1 (37-x-y) (#48614)
* chore: bump node in DEPS to v22.21.0 * chore: bump node in DEPS to v22.21.1 * chore: update patches * lib,src: refactor assert to load error source from memory nodejs/node#59751 * src: add percentage support to --max-old-space-size nodejs/node#59082 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
1 parent 800bfde commit 8647ef3

24 files changed

Lines changed: 91 additions & 159 deletions

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vars = {
44
'chromium_version':
55
'138.0.7204.251',
66
'node_version':
7-
'v22.20.0',
7+
'v22.21.1',
88
'nan_version':
99
'e14bdcd1f72d62bca1d541b66da43130384ec213',
1010
'squirrel.mac_version':

patches/node/.patches

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ chore_expose_importmoduledynamically_and.patch
1717
test_formally_mark_some_tests_as_flaky.patch
1818
fix_do_not_resolve_electron_entrypoints.patch
1919
ci_ensure_node_tests_set_electron_run_as_node.patch
20-
fix_assert_module_in_the_renderer_process.patch
2120
fix_allow_passing_fileexists_fn_to_legacymainresolve.patch
2221
fix_remove_deprecated_errno_constants.patch
2322
build_enable_perfetto.patch

patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error: duplicate symbol: crdtp::ProtocolTypeTraits<std::__Cr::basic_string<char,
1414
Some distinguishing change should be upstreamed to Node.js.
1515

1616
diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc
17-
index 8521730bd03cdfce47e9b5d0f5d68a568bc3de8c..28f4598aa7ea0e93350f79566c06d0f08313be9f 100644
17+
index e2148e954217b9b999e9713e95f1a115ccf7d657..7ec7464cdc0ef00e6600fb897ae99e44ed0f4ad8 100644
1818
--- a/src/inspector/node_string.cc
1919
+++ b/src/inspector/node_string.cc
2020
@@ -7,7 +7,8 @@

patches/node/build_enable_perfetto.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ index 8d7204f6cb48f783adc4d1c1eb2de0c83b7fffe2..a154559a56bf383d3c26af523c9bb07b
3333

3434
// Non-alphabetic chars.
3535
diff --git a/lib/internal/http.js b/lib/internal/http.js
36-
index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327199acfd5 100644
36+
index 4f250a2e70a20fddeeb7886e0c269822883f7ccf..4e5c2dd1f13e6818576c3c4c88200b5cf5fb1257 100644
3737
--- a/lib/internal/http.js
3838
+++ b/lib/internal/http.js
39-
@@ -8,8 +8,8 @@ const {
39+
@@ -10,8 +10,8 @@ const {
4040
const { setUnrefTimeout } = require('internal/timers');
4141
const { getCategoryEnabledBuffer, trace } = internalBinding('trace_events');
4242
const {
@@ -46,8 +46,8 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
4646
+ CHAR_UPPERCASE_E,
4747
} = require('internal/constants');
4848

49-
let utcCache;
50-
@@ -44,11 +44,13 @@ function isTraceHTTPEnabled() {
49+
const { URL } = require('internal/url');
50+
@@ -50,11 +50,13 @@ function isTraceHTTPEnabled() {
5151
const traceEventCategory = 'node,node.http';
5252

5353
function traceBegin(...args) {
@@ -62,7 +62,7 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
6262
+ trace(CHAR_UPPERCASE_E, traceEventCategory, ...args);
6363
}
6464

65-
module.exports = {
65+
function ipToInt(ip) {
6666
diff --git a/node.gyp b/node.gyp
6767
index 0e0071b508f605bb9b7722f8304814dc176d907e..bcb9f371c4e4d8c665058115dc39eaa65125d679 100644
6868
--- a/node.gyp

patches/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
88
of this.
99

1010
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
11-
index 98ed40e3076f6628b1771dade63ac51600e8e447..1eba13caf1e00a8b41b2cf8afc4168c8f98be69f 100644
11+
index d12d21905c4823f45cffeea4423e99e81b1008f5..4987cd3f6c9eefb440bca3f58113df6cd5b410ac 100644
1212
--- a/lib/internal/process/pre_execution.js
1313
+++ b/lib/internal/process/pre_execution.js
14-
@@ -245,12 +245,14 @@ function patchProcessObject(expandArgv1) {
14+
@@ -267,12 +267,14 @@ function patchProcessObject(expandArgv1) {
1515
// the entry point.
1616
if (expandArgv1 && process.argv[1] && process.argv[1][0] !== '-') {
1717
// Expand process.argv[1] into a full path.

patches/node/chore_expose_importmoduledynamically_and.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ index 9b41db8b0714b7408f79cbd5b4c460d9bc08f239..35ecfb9bbaf2c8e7351e1c69da84c82a
4040

4141
/**
4242
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
43-
index c52e20d742942667f43ea3e151fc6702260b176b..cbb3e7f4df72f83cb8a1afc25a7429218792e964 100644
43+
index 1ff4971d6fedf6090120a63ba0af420dd6929c8b..4a35e41e78a22993f87ab9d5919f401a7b742438 100644
4444
--- a/src/module_wrap.cc
4545
+++ b/src/module_wrap.cc
46-
@@ -901,7 +901,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
47-
return module->module_.Get(isolate);
46+
@@ -1063,7 +1063,7 @@ Maybe<ModuleWrap*> ModuleWrap::ResolveModule(
47+
return Just(module_wrap);
4848
}
4949

5050
-static MaybeLocal<Promise> ImportModuleDynamically(
5151
+MaybeLocal<Promise> ImportModuleDynamically(
5252
Local<Context> context,
5353
Local<Data> host_defined_options,
5454
Local<Value> resource_name,
55-
@@ -973,12 +973,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
55+
@@ -1135,12 +1135,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
5656
Realm* realm = Realm::GetCurrent(args);
5757
HandleScope handle_scope(isolate);
5858

@@ -68,7 +68,7 @@ index c52e20d742942667f43ea3e151fc6702260b176b..cbb3e7f4df72f83cb8a1afc25a742921
6868
}
6969

7070
void ModuleWrap::HostInitializeImportMetaObjectCallback(
71-
@@ -1020,13 +1021,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
71+
@@ -1182,13 +1183,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
7272
Realm* realm = Realm::GetCurrent(args);
7373
Isolate* isolate = realm->isolate();
7474

@@ -87,7 +87,7 @@ index c52e20d742942667f43ea3e151fc6702260b176b..cbb3e7f4df72f83cb8a1afc25a742921
8787

8888
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
8989
diff --git a/src/module_wrap.h b/src/module_wrap.h
90-
index 9363ce73e51cde3d3a94f9912f072d532d0f8560..c0e972ed293157726efc5fa76dfa62d3da51c22a 100644
90+
index 695b73ca7ffea850cd88e94546125d12ddc991f6..09602a8e619ba52f3525e3d312047c6dba0484a5 100644
9191
--- a/src/module_wrap.h
9292
+++ b/src/module_wrap.h
9393
@@ -8,6 +8,7 @@
@@ -98,8 +98,8 @@ index 9363ce73e51cde3d3a94f9912f072d532d0f8560..c0e972ed293157726efc5fa76dfa62d3
9898
#include "v8-script.h"
9999

100100
namespace node {
101-
@@ -33,7 +34,14 @@ enum HostDefinedOptions : int {
102-
kLength = 9,
101+
@@ -86,7 +87,14 @@ struct ModuleCacheKey : public MemoryRetainer {
102+
hash(hash) {}
103103
};
104104

105105
-class ModuleWrap : public BaseObject {
@@ -111,10 +111,10 @@ index 9363ce73e51cde3d3a94f9912f072d532d0f8560..c0e972ed293157726efc5fa76dfa62d3
111111
+ v8::Local<v8::FixedArray> import_assertions);
112112
+
113113
+class NODE_EXTERN ModuleWrap : public BaseObject {
114-
public:
115-
enum InternalFields {
116-
kModuleSlot = BaseObject::kInternalFieldCount,
117-
@@ -92,6 +100,8 @@ class ModuleWrap : public BaseObject {
114+
using ResolveCache =
115+
std::unordered_map<ModuleCacheKey, uint32_t, ModuleCacheKey::Hash>;
116+
117+
@@ -151,6 +159,8 @@ class ModuleWrap : public BaseObject {
118118
static void CreateRequiredModuleFacade(
119119
const v8::FunctionCallbackInfo<v8::Value>& args);
120120

@@ -123,11 +123,11 @@ index 9363ce73e51cde3d3a94f9912f072d532d0f8560..c0e972ed293157726efc5fa76dfa62d3
123123
private:
124124
ModuleWrap(Realm* realm,
125125
v8::Local<v8::Object> object,
126-
@@ -131,7 +141,6 @@ class ModuleWrap : public BaseObject {
126+
@@ -190,7 +200,6 @@ class ModuleWrap : public BaseObject {
127127
v8::Local<v8::String> specifier,
128128
v8::Local<v8::FixedArray> import_attributes,
129129
v8::Local<v8::Module> referrer);
130130
- static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
131131

132-
v8::Global<v8::Module> module_;
133-
std::unordered_map<std::string, v8::Global<v8::Object>> resolve_cache_;
132+
// This method may throw a JavaScript exception, so the return type is
133+
// wrapped in a Maybe.

patches/node/cli_move_--trace-atomics-wait_to_eol.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1515
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
1616

1717
diff --git a/doc/api/cli.md b/doc/api/cli.md
18-
index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3f5598a9e 100644
18+
index a97053929c81ac18bcb3beda7cecb69621b6e70c..a54d0e46c8e4e3aa6be433fba73ef9a3228fa175 100644
1919
--- a/doc/api/cli.md
2020
+++ b/doc/api/cli.md
21-
@@ -2727,39 +2727,6 @@ added: v12.0.0
21+
@@ -2749,39 +2749,6 @@ added: v12.0.0
2222
Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
2323
for TLSv1.2, which is not as secure as TLSv1.3.
2424

@@ -58,7 +58,7 @@ index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3
5858
### `--trace-deprecation`
5959

6060
<!-- YAML
61-
@@ -3445,7 +3412,6 @@ one is included in the list below.
61+
@@ -3483,7 +3450,6 @@ one is included in the list below.
6262
* `--tls-min-v1.1`
6363
* `--tls-min-v1.2`
6464
* `--tls-min-v1.3`
@@ -67,10 +67,10 @@ index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3
6767
* `--trace-env-js-stack`
6868
* `--trace-env-native-stack`
6969
diff --git a/doc/node.1 b/doc/node.1
70-
index e3b2c45af01b2e9b9522964da2572988edd2b9e9..64e975546285a1042dda6fdb54fdd502f338a929 100644
70+
index fed2c77c2afed665be7aa17c2d53824f049a909e..7a3c09a40fca9458f83be1e7d8eec930b7d2d263 100644
7171
--- a/doc/node.1
7272
+++ b/doc/node.1
73-
@@ -542,11 +542,6 @@ but the option is supported for compatibility with older Node.js versions.
73+
@@ -556,11 +556,6 @@ but the option is supported for compatibility with older Node.js versions.
7474
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
7575
favour of TLSv1.3, which is more secure.
7676
.
@@ -83,7 +83,7 @@ index e3b2c45af01b2e9b9522964da2572988edd2b9e9..64e975546285a1042dda6fdb54fdd502
8383
Print stack traces for deprecations.
8484
.
8585
diff --git a/src/node.cc b/src/node.cc
86-
index f0c0b6229048a2e9bc05684fab44ab09bc34e1f6..9027df9a321f7db76edd1218c194df519017dfaf 100644
86+
index 029b0d219e3bbfa4306d7d5fb5e75f1abc1571bb..2224b5d4e21f435cff1f1ebef2b9e8635bd0368e 100644
8787
--- a/src/node.cc
8888
+++ b/src/node.cc
8989
@@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() {
@@ -150,10 +150,10 @@ index f0c0b6229048a2e9bc05684fab44ab09bc34e1f6..9027df9a321f7db76edd1218c194df51
150150
isolate_->SetPromiseHook(TracePromises);
151151
}
152152
diff --git a/src/node_options.cc b/src/node_options.cc
153-
index e8424d7539db191a55edebb7d33a3c1dc37e2403..556776b79282d953fdc371d1901f21ca301bec1a 100644
153+
index 4bbace2f702777fa12ba9246984894721df99b50..b067685822dc056e446e1a9402a5a6cba86cc722 100644
154154
--- a/src/node_options.cc
155155
+++ b/src/node_options.cc
156-
@@ -773,10 +773,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
156+
@@ -827,10 +827,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
157157
"throw an exception on deprecations",
158158
&EnvironmentOptions::throw_deprecation,
159159
kAllowedInEnvvar);
@@ -165,7 +165,7 @@ index e8424d7539db191a55edebb7d33a3c1dc37e2403..556776b79282d953fdc371d1901f21ca
165165
"show stack traces on deprecations",
166166
&EnvironmentOptions::trace_deprecation,
167167
diff --git a/src/node_options.h b/src/node_options.h
168-
index 418dee360f867c363f1576012b32213a51c4fdd0..7078d2493ed696bc5bd92df9c629b714c1a8fbfb 100644
168+
index d8751a6ee734233e2fc24866ed87d9cd516072ae..e12abb55e43068e8446eaabc65deb63cc469f554 100644
169169
--- a/src/node_options.h
170170
+++ b/src/node_options.h
171171
@@ -205,7 +205,6 @@ class EnvironmentOptions : public Options {

patches/node/cli_remove_deprecated_v8_flag.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
1818
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1919

2020
diff --git a/doc/api/cli.md b/doc/api/cli.md
21-
index b8f9fb49fcb45602828e79bd79902233b5987dda..9a0e83b95a72486ab9751b3b8818f4beeb527041 100644
21+
index 7ff68d28f1c80d8a852f649e2c39216a2f4bdb16..a97053929c81ac18bcb3beda7cecb69621b6e70c 100644
2222
--- a/doc/api/cli.md
2323
+++ b/doc/api/cli.md
24-
@@ -3483,7 +3483,6 @@ V8 options that are allowed are:
24+
@@ -3522,7 +3522,6 @@ V8 options that are allowed are:
2525
* `--disallow-code-generation-from-strings`
2626
* `--enable-etw-stack-walking`
2727
* `--expose-gc`
@@ -30,10 +30,10 @@ index b8f9fb49fcb45602828e79bd79902233b5987dda..9a0e83b95a72486ab9751b3b8818f4be
3030
* `--jitless`
3131
* `--max-old-space-size`
3232
diff --git a/src/node_options.cc b/src/node_options.cc
33-
index 8afded658c3f569de7b329ea9dddc11010748cf9..e8424d7539db191a55edebb7d33a3c1dc37e2403 100644
33+
index 3026b3d814ae652a9996c1dcba62b4fa678ac871..4bbace2f702777fa12ba9246984894721df99b50 100644
3434
--- a/src/node_options.cc
3535
+++ b/src/node_options.cc
36-
@@ -1001,11 +1001,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
36+
@@ -1060,11 +1060,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
3737
"disallow eval and friends",
3838
V8Option{},
3939
kAllowedInEnvvar);

patches/node/fix_allow_passing_fileexists_fn_to_legacymainresolve.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ index e3afd30ba1f591d0298793bc42fd7166a4219bce..408dc96307d7f52f92db41004b358051
5353
const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ?
5454
packageConfig.main || './' : '';
5555
diff --git a/src/node_file.cc b/src/node_file.cc
56-
index e78326ed0de805a8bf4f621cad9158635eb44aa2..d7009937b31729f33d9c45cbda7f5440fbdac2aa 100644
56+
index 77f8f1bd4e8294f2ebc7e0724aea5902eb0f95ab..5de3ebb04b12286a07e3041d0a6dd1cc9072e76a 100644
5757
--- a/src/node_file.cc
5858
+++ b/src/node_file.cc
59-
@@ -3502,13 +3502,25 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
59+
@@ -3504,13 +3504,25 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
6060
}
6161

6262
BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile(
@@ -83,7 +83,7 @@ index e78326ed0de805a8bf4f621cad9158635eb44aa2..d7009937b31729f33d9c45cbda7f5440
8383
uv_fs_t req;
8484

8585
int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr);
86-
@@ -3566,6 +3578,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
86+
@@ -3568,6 +3580,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
8787
std::optional<std::string> initial_file_path;
8888
std::string file_path;
8989

@@ -95,7 +95,7 @@ index e78326ed0de805a8bf4f621cad9158635eb44aa2..d7009937b31729f33d9c45cbda7f5440
9595
if (args.Length() >= 2 && args[1]->IsString()) {
9696
auto package_config_main = Utf8Value(isolate, args[1]).ToString();
9797

98-
@@ -3586,7 +3603,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
98+
@@ -3588,7 +3605,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
9999
BufferValue buff_file_path(isolate, local_file_path);
100100
ToNamespacedPath(env, &buff_file_path);
101101

@@ -104,7 +104,7 @@ index e78326ed0de805a8bf4f621cad9158635eb44aa2..d7009937b31729f33d9c45cbda7f5440
104104
case BindingData::FilePathIsFileReturnType::kIsFile:
105105
return args.GetReturnValue().Set(i);
106106
case BindingData::FilePathIsFileReturnType::kIsNotFile:
107-
@@ -3623,7 +3640,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
107+
@@ -3625,7 +3642,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
108108
BufferValue buff_file_path(isolate, local_file_path);
109109
ToNamespacedPath(env, &buff_file_path);
110110

patches/node/fix_assert_module_in_the_renderer_process.patch

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)