chore: bump node to v22.16.0 (main) (#47217)

* chore: bump node in DEPS to v22.16.0

* crypto: remove BoringSSL dh-primes addition

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

* tools: enable linter in test/fixtures/test\-runner/output

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

* src: improve thread safety of TaskQueue

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

* buffer: define global v8::CFunction objects as const

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

* src: disable abseil deadlock detection

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

* zlib: fix pointer alignment

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

* chore: fixup patch indices

* src: set default config as node.config.json

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

* src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>

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

* test: disable chmod tests failing in Docker

https://github.com/nodejs/node/issues/58326

---------

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-06-02 17:30:15 -04:00 committed by GitHub
parent 55006fe9a8
commit 82a59d9894
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 177 additions and 223 deletions

2
DEPS
View file

@ -4,7 +4,7 @@ vars = {
'chromium_version': 'chromium_version':
'138.0.7178.0', '138.0.7178.0',
'node_version': 'node_version':
'v22.15.1', 'v22.16.0',
'nan_version': 'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213', 'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version': 'squirrel.mac_version':

View file

@ -47,6 +47,5 @@ fix_ensure_traverseparent_bails_on_resource_path_exit.patch
cli_move_--trace-atomics-wait_to_eol.patch cli_move_--trace-atomics-wait_to_eol.patch
fix_cppgc_initializing_twice.patch fix_cppgc_initializing_twice.patch
fix_task_starvation_in_inspector_context_test.patch fix_task_starvation_in_inspector_context_test.patch
zlib_fix_pointer_alignment.patch
fix_expose_readfilesync_override_for_modules.patch fix_expose_readfilesync_override_for_modules.patch
test_force_slow_json_stringify_path_for_overflow.patch test_force_slow_json_stringify_path_for_overflow.patch

View file

@ -8,10 +8,10 @@ naturally upstream, and we will be able to remove this patch in a future
Node.js upgrade. Node.js upgrade.
diff --git a/src/node_platform.cc b/src/node_platform.cc diff --git a/src/node_platform.cc b/src/node_platform.cc
index 65a9b79ae6ac8b7589e8f8109a709acb41d12b97..743ac069ad579a208a632ef5096ae46c8a0dfd74 100644 index b438b3774d0aa7680fdbc6c6bf39a87893d221b2..ec355061825fb861c17fa2e6cc967b4c7b8d4586 100644
--- a/src/node_platform.cc --- a/src/node_platform.cc
+++ b/src/node_platform.cc +++ b/src/node_platform.cc
@@ -556,8 +556,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { @@ -687,8 +687,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
return ForIsolate(isolate)->IdleTasksEnabled(); return ForIsolate(isolate)->IdleTasksEnabled();
} }
@ -23,10 +23,10 @@ index 65a9b79ae6ac8b7589e8f8109a709acb41d12b97..743ac069ad579a208a632ef5096ae46c
} }
diff --git a/src/node_platform.h b/src/node_platform.h diff --git a/src/node_platform.h b/src/node_platform.h
index dde2d1b5687a5b52a4f09183bb4ff88d7d3e4d01..0a99f5b4b5eeb221ef3a34db7a50955c32d3c163 100644 index a0222b4a1b074c6708e390d58d04221717069ac1..8015ca1801573c3a7c4a5db6d0f10b4016a9267c 100644
--- a/src/node_platform.h --- a/src/node_platform.h
+++ b/src/node_platform.h +++ b/src/node_platform.h
@@ -177,7 +177,7 @@ class NodePlatform : public MultiIsolatePlatform { @@ -213,7 +213,7 @@ class NodePlatform : public MultiIsolatePlatform {
void (*callback)(void*), void* data) override; void (*callback)(void*), void* data) override;
std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner( std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(

View file

@ -55,10 +55,10 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f
assert(!node_enable_inspector || node_use_openssl, assert(!node_enable_inspector || node_use_openssl,
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c63e4bde24 100644 index defb657a62a0316224a02b68505ac1142fd89d03..d637faac88875bfa110e2b8d1f53962061d98279 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -783,6 +783,7 @@ void BuiltinLoader::RegisterExternalReferences( @@ -785,6 +785,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives); registry->Register(GetNatives);
RegisterExternalReferencesForInternalizedBuiltinCode(registry); RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@ -67,7 +67,7 @@ index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c6
} // namespace builtins } // namespace builtins
diff --git a/src/node_builtins.h b/src/node_builtins.h diff --git a/src/node_builtins.h b/src/node_builtins.h
index a73de23a1debfdac66873e0baccf882e383bfc36..7ac5291be093773ee7efd39e77e01bf5d5ce5247 100644 index f9426599f2d5dc6ad061407f0c4eb2c9203a4433..302030f610965f07dd6998d282275c1bdf738009 100644
--- a/src/node_builtins.h --- a/src/node_builtins.h
+++ b/src/node_builtins.h +++ b/src/node_builtins.h
@@ -74,6 +74,8 @@ using BuiltinCodeCacheMap = @@ -74,6 +74,8 @@ using BuiltinCodeCacheMap =
@ -258,10 +258,10 @@ index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd1
if sys.platform == 'win32': if sys.platform == 'win32':
files = [ x.replace('\\', '/') for x in files ] files = [ x.replace('\\', '/') for x in files ]
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50ae50a3d8 100644 index 44641b92678ab2f28e6f5de75a92878f9f3d322d..e17e4f043af6e4047ab82723ffd83187f3c04c5c 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -142,32 +142,39 @@ template("node_gn_build") { @@ -142,32 +142,42 @@ template("node_gn_build") {
public_configs = [ public_configs = [
":node_external_config", ":node_external_config",
"deps/googletest:googletest_config", "deps/googletest:googletest_config",
@ -296,7 +296,10 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
"$node_v8_path:v8_libplatform", "$node_v8_path:v8_libplatform",
] ]
+ cflags_cc = [ "-Wno-unguarded-availability-new" ] + cflags_cc = [
+ "-Wno-unguarded-availability-new",
+ "-Wno-return-stack-address"
+ ]
+ +
sources = [ sources = [
+ "src/node_snapshot_stub.cc", + "src/node_snapshot_stub.cc",
@ -304,7 +307,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
"$target_gen_dir/node_javascript.cc", "$target_gen_dir/node_javascript.cc",
] + gypi_values.node_sources ] + gypi_values.node_sources
@@ -190,7 +197,7 @@ template("node_gn_build") { @@ -190,7 +200,7 @@ template("node_gn_build") {
} }
if (node_use_openssl) { if (node_use_openssl) {
deps += [ "deps/ncrypto" ] deps += [ "deps/ncrypto" ]
@ -313,7 +316,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
sources += gypi_values.node_crypto_sources sources += gypi_values.node_crypto_sources
} }
if (node_enable_inspector) { if (node_enable_inspector) {
@@ -214,6 +221,10 @@ template("node_gn_build") { @@ -214,6 +224,10 @@ template("node_gn_build") {
} }
} }
@ -324,7 +327,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
executable(target_name) { executable(target_name) {
forward_variables_from(invoker, "*") forward_variables_from(invoker, "*")
@@ -288,6 +299,7 @@ template("node_gn_build") { @@ -288,6 +302,7 @@ template("node_gn_build") {
} }
executable("node_js2c") { executable("node_js2c") {
@ -332,7 +335,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
deps = [ deps = [
"deps/uv", "deps/uv",
"$node_simdutf_path", "$node_simdutf_path",
@@ -298,26 +310,75 @@ template("node_gn_build") { @@ -298,26 +313,75 @@ template("node_gn_build") {
"src/embedded_data.cc", "src/embedded_data.cc",
"src/embedded_data.h", "src/embedded_data.h",
] ]
@ -418,7 +421,7 @@ index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50
outputs = [ "$target_gen_dir/node_javascript.cc" ] outputs = [ "$target_gen_dir/node_javascript.cc" ]
# Get the path to node_js2c executable of the host toolchain. # Get the path to node_js2c executable of the host toolchain.
@@ -331,11 +392,11 @@ template("node_gn_build") { @@ -331,11 +395,11 @@ template("node_gn_build") {
get_label_info(":node_js2c($host_toolchain)", "name") + get_label_info(":node_js2c($host_toolchain)", "name") +
host_executable_suffix host_executable_suffix

View file

@ -14,7 +14,7 @@ We don't need to do this for zlib, as the existing gn workflow uses the same
Upstreamed at https://github.com/nodejs/node/pull/55903 Upstreamed at https://github.com/nodejs/node/pull/55903
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f756b2e34a 100644 index e17e4f043af6e4047ab82723ffd83187f3c04c5c..d591dfc99fdea4f830008502786ee44d863a31fc 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -155,7 +155,6 @@ template("node_gn_build") { @@ -155,7 +155,6 @@ template("node_gn_build") {
@ -25,7 +25,7 @@ index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f7
"deps/nbytes", "deps/nbytes",
"deps/nghttp2", "deps/nghttp2",
"deps/postject", "deps/postject",
@@ -191,7 +190,17 @@ template("node_gn_build") { @@ -194,7 +193,17 @@ template("node_gn_build") {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ] configs += [ "//build/config/gcc:symbol_visibility_default" ]
} }
@ -44,7 +44,7 @@ index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f7
if (v8_enable_i18n_support) { if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ] deps += [ "//third_party/icu" ]
} }
@@ -219,6 +228,19 @@ template("node_gn_build") { @@ -222,6 +231,19 @@ template("node_gn_build") {
sources += node_inspector.node_inspector_sources + sources += node_inspector.node_inspector_sources +
node_inspector.node_inspector_generated_sources node_inspector.node_inspector_generated_sources
} }

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. 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 diff --git a/common.gypi b/common.gypi
index 53016fc79c3d914982abeb61bf0a76181024e2bf..99b147482b636706b1372b89298f35b60ca2bb31 100644 index f3476a91e4c3cda7cecf49e07bb594a167ac46ef..de73f6c18131f43e6fe3107c866599aa3398cf10 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -530,7 +530,7 @@ @@ -530,7 +530,7 @@

View file

@ -64,10 +64,10 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
module.exports = { module.exports = {
diff --git a/node.gyp b/node.gyp diff --git a/node.gyp b/node.gyp
index ec1f90b73f7d119b2c0e0207a5e36f3cec7295e9..66244b6638e34536aed397f56c6a4570a73e9b90 100644 index ad010a8d99cf08013b7202eddce66e5b3885652d..d735b887d05ddfadec8e56dd8eae09646890aa84 100644
--- a/node.gyp --- a/node.gyp
+++ b/node.gyp +++ b/node.gyp
@@ -175,7 +175,6 @@ @@ -176,7 +176,6 @@
'src/timers.cc', 'src/timers.cc',
'src/timer_wrap.cc', 'src/timer_wrap.cc',
'src/tracing/agent.cc', 'src/tracing/agent.cc',
@ -75,7 +75,7 @@ index ec1f90b73f7d119b2c0e0207a5e36f3cec7295e9..66244b6638e34536aed397f56c6a4570
'src/tracing/node_trace_writer.cc', 'src/tracing/node_trace_writer.cc',
'src/tracing/trace_event.cc', 'src/tracing/trace_event.cc',
'src/tracing/traced_value.cc', 'src/tracing/traced_value.cc',
@@ -303,7 +302,6 @@ @@ -305,7 +304,6 @@
'src/tcp_wrap.h', 'src/tcp_wrap.h',
'src/timers.h', 'src/timers.h',
'src/tracing/agent.h', 'src/tracing/agent.h',

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. This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index f2a45f0f0bbfce93e61d3696a18425af4d022a00..53016fc79c3d914982abeb61bf0a76181024e2bf 100644 index d9c0b721fe0a629a30efb3c4e04905176ca0a7f5..f3476a91e4c3cda7cecf49e07bb594a167ac46ef 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -88,6 +88,8 @@ @@ -88,6 +88,8 @@
@ -40,7 +40,7 @@ index f2a45f0f0bbfce93e61d3696a18425af4d022a00..53016fc79c3d914982abeb61bf0a7618
# list in v8/BUILD.gn. # list in v8/BUILD.gn.
['v8_enable_v8_checks == 1', { ['v8_enable_v8_checks == 1', {
diff --git a/configure.py b/configure.py diff --git a/configure.py b/configure.py
index 95faeeef3867cbf3ca4b1857d893aa127d550a2f..b36f63a5482074f79a20709b8c4774cb6dadec52 100755 index 932484674e5b15b765b8bfe307bdf99b49b5039f..befaa85527b9ebebad226e603586e23d04ec1e51 100755
--- a/configure.py --- a/configure.py
+++ b/configure.py +++ b/configure.py
@@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None): @@ -1698,6 +1698,7 @@ def configure_library(lib, output, pkgname=None):
@ -52,7 +52,7 @@ index 95faeeef3867cbf3ca4b1857d893aa127d550a2f..b36f63a5482074f79a20709b8c4774cb
o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index 8b77f7cb4d53105f42ba76d99a76a98b7a73789f..bdc77f8eb7abffa9e6c98cd254daedad3e44b981 100644 index 835c78145956de3d8c52b6cc0581bcfef600f90b..174fd4d1af4c8cd75aec09f4548a674fd5539fb2 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -22,6 +22,12 @@ @@ -22,6 +22,12 @@

View file

@ -34,10 +34,10 @@ index 411eab8136d5957ae8a491bc38ffbdc88e59f5da..63c93b5be09692d0d4b6bfbb214b173b
let kResistStopPropagation; let kResistStopPropagation;
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 04eab49c368c8f86837ed2c1384bf3c63e4bde24..c3d2b3c90c206dd81a3d8aa6c14fdf4678a1cddd 100644 index d637faac88875bfa110e2b8d1f53962061d98279..e0b58c4d0ac5640a677c22d710f88f1b318378d7 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -34,6 +34,7 @@ using v8::Value; @@ -35,6 +35,7 @@ using v8::Value;
BuiltinLoader::BuiltinLoader() BuiltinLoader::BuiltinLoader()
: config_(GetConfig()), code_cache_(std::make_shared<BuiltinCodeCache>()) { : config_(GetConfig()), code_cache_(std::make_shared<BuiltinCodeCache>()) {
LoadJavaScriptSource(); LoadJavaScriptSource();
@ -46,7 +46,7 @@ index 04eab49c368c8f86837ed2c1384bf3c63e4bde24..c3d2b3c90c206dd81a3d8aa6c14fdf46
AddExternalizedBuiltin( AddExternalizedBuiltin(
"internal/deps/cjs-module-lexer/lexer", "internal/deps/cjs-module-lexer/lexer",
diff --git a/src/node_builtins.h b/src/node_builtins.h diff --git a/src/node_builtins.h b/src/node_builtins.h
index 7ac5291be093773ee7efd39e77e01bf5d5ce5247..c3c987d535285be84026ad0c633650bd2067d22d 100644 index 302030f610965f07dd6998d282275c1bdf738009..35cb7766eeccc62dd2f0ce9484a2f1ec7beccc05 100644
--- a/src/node_builtins.h --- a/src/node_builtins.h
+++ b/src/node_builtins.h +++ b/src/node_builtins.h
@@ -138,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader { @@ -138,6 +138,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {

View file

@ -65,10 +65,10 @@ index 3d7aa148678b2646b88fa7c32abec91791b02b82..4810d93eb971b253f7dadff7011a632f
gypi_values = exec_script( gypi_values = exec_script(
"../../tools/gypi_to_gn.py", "../../tools/gypi_to_gn.py",
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index a8ce18acfe333350f91b3e5f235db5f756b2e34a..6bcc40b282543fc40f80c5c6659de658209844b8 100644 index d591dfc99fdea4f830008502786ee44d863a31fc..9e26399482d6a1cdb843efb72c152d5cdd5e08ea 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -211,13 +211,14 @@ template("node_gn_build") { @@ -214,13 +214,14 @@ template("node_gn_build") {
} }
if (node_enable_inspector) { if (node_enable_inspector) {
deps += [ deps += [

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. in which the binary got built.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index 99b147482b636706b1372b89298f35b60ca2bb31..5024e5fb0aee210f4986572638a523db6d26b4cc 100644 index de73f6c18131f43e6fe3107c866599aa3398cf10..e2171e14b9e29dfc3c629f8164545d56d5e9057e 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -127,6 +127,7 @@ @@ -127,6 +127,7 @@

View file

@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
of this. of this.
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index d1c05d1717cdc825c4e48885c963c9ed65bcf51c..278665921c5160ff10b3178db27d4df319fab6b3 100644 index 4e7be0594ca1e1ceaf1963debbce46783893ed77..a6df0672bf6ae6e9a74ebbb0e4debff63599cc99 100644
--- a/lib/internal/process/pre_execution.js --- a/lib/internal/process/pre_execution.js
+++ b/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js
@@ -243,12 +243,14 @@ function patchProcessObject(expandArgv1) { @@ -245,12 +245,14 @@ function patchProcessObject(expandArgv1) {
// the entry point. // the entry point.
if (expandArgv1 && process.argv[1] && process.argv[1][0] !== '-') { if (expandArgv1 && process.argv[1] && process.argv[1][0] !== '-') {
// Expand process.argv[1] into a full path. // Expand process.argv[1] into a full path.

View file

@ -8,15 +8,18 @@ which causes the `ELECTRON_RUN_AS_NODE` variable to be lost. This patch
re-injects it. re-injects it.
diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js
index af23e674cb361ed81dafa22670d5633559cd1144..1dd59990cb7cdba8aecf4f499ee6b92e7cd41b30 100644 index 444531da1df2f9bbbc19bb8a43fb6eb2d1802d1a..81b3b3e37e5664dc53bec987a2ce3a83a8da105f 100644
--- a/test/fixtures/test-runner/output/arbitrary-output-colored.js --- a/test/fixtures/test-runner/output/arbitrary-output-colored.js
+++ b/test/fixtures/test-runner/output/arbitrary-output-colored.js +++ b/test/fixtures/test-runner/output/arbitrary-output-colored.js
@@ -7,6 +7,6 @@ const fixtures = require('../../../common/fixtures'); @@ -7,9 +7,9 @@ const fixtures = require('../../../common/fixtures');
(async function run() { (async function run() {
const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js'); const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js');
const reset = fixtures.path('test-runner/output/reset-color-depth.js'); const reset = fixtures.path('test-runner/output/reset-color-depth.js');
- await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit' }), 'exit'); - await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit' }), 'exit');
- await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }), 'exit');
+ await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}), 'exit'); + await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}), 'exit');
+ await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 } }), 'exit'); await once(
- spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }),
+ spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1 }}),
'exit',
);
})().then(common.mustCall()); })().then(common.mustCall());

View file

@ -15,10 +15,10 @@ Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
diff --git a/doc/api/cli.md b/doc/api/cli.md diff --git a/doc/api/cli.md b/doc/api/cli.md
index 114b7bbf6b1e105fc1696ed8a064065db73ff519..ad863e52761332c3249a86af0e3d239cd0f73b03 100644 index 121d8f2bbd2b1d93067a06a902b1e7b986bcdb49..3460ad33c6186dcc3aa3281d80b723a1cc1d50dd 100644
--- a/doc/api/cli.md --- a/doc/api/cli.md
+++ b/doc/api/cli.md +++ b/doc/api/cli.md
@@ -3313,7 +3313,6 @@ one is included in the list below. @@ -3367,7 +3367,6 @@ one is included in the list below.
* `--tls-min-v1.1` * `--tls-min-v1.1`
* `--tls-min-v1.2` * `--tls-min-v1.2`
* `--tls-min-v1.3` * `--tls-min-v1.3`
@ -27,10 +27,10 @@ index 114b7bbf6b1e105fc1696ed8a064065db73ff519..ad863e52761332c3249a86af0e3d239c
* `--trace-env-js-stack` * `--trace-env-js-stack`
* `--trace-env-native-stack` * `--trace-env-native-stack`
diff --git a/doc/node.1 b/doc/node.1 diff --git a/doc/node.1 b/doc/node.1
index 9f534746ef9d9c1c1ee2edd6c195573a2e228600..e01fc511a1034518c0fb9bc5fa925524aecad927 100644 index 663d123ac728f097e8a76c94cf10c53d059983d7..497f5a61182beafbaa26b945181056353674cfc3 100644
--- a/doc/node.1 --- a/doc/node.1
+++ b/doc/node.1 +++ b/doc/node.1
@@ -533,11 +533,6 @@ but the option is supported for compatibility with older Node.js versions. @@ -539,11 +539,6 @@ but the option is supported for compatibility with older Node.js versions.
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
favour of TLSv1.3, which is more secure. favour of TLSv1.3, which is more secure.
. .
@ -43,10 +43,10 @@ index 9f534746ef9d9c1c1ee2edd6c195573a2e228600..e01fc511a1034518c0fb9bc5fa925524
Print stack traces for deprecations. Print stack traces for deprecations.
. .
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 2f58a6fa69069dabb99b5ddb8011991b07fa5f02..9f6fa646ba6673f67f5f625e157ed850633a26da 100644 index 6f8f6386d0db8aef1e2e0126cc9064101cbe6112..bc670a6c8b5027417cdc35e1cd94a60f63fd342d 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -226,44 +226,6 @@ void Environment::WaitForInspectorFrontendByOptions() { @@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() {
} }
#endif // HAVE_INSPECTOR #endif // HAVE_INSPECTOR
@ -91,7 +91,7 @@ index 2f58a6fa69069dabb99b5ddb8011991b07fa5f02..9f6fa646ba6673f67f5f625e157ed850
void Environment::InitializeDiagnostics() { void Environment::InitializeDiagnostics() {
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback( isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
Environment::BuildEmbedderGraph, this); Environment::BuildEmbedderGraph, this);
@@ -272,17 +234,6 @@ void Environment::InitializeDiagnostics() { @@ -278,17 +240,6 @@ void Environment::InitializeDiagnostics() {
} }
if (options_->trace_uncaught) if (options_->trace_uncaught)
isolate_->SetCaptureStackTraceForUncaughtExceptions(true); isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
@ -110,10 +110,10 @@ index 2f58a6fa69069dabb99b5ddb8011991b07fa5f02..9f6fa646ba6673f67f5f625e157ed850
isolate_->SetPromiseHook(TracePromises); isolate_->SetPromiseHook(TracePromises);
} }
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index 54b253aa54f5cdebdb04315f9c6c2506977555c0..acf390bd456c7ddfa6987e440fb45940aec6b1ff 100644 index a9500716f2a955fc591628a969c5fba40783a2e7..b153d2c6a771e80bcdf5ed6adbc1cd225b3bf97e 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -762,10 +762,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { @@ -770,10 +770,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"throw an exception on deprecations", "throw an exception on deprecations",
&EnvironmentOptions::throw_deprecation, &EnvironmentOptions::throw_deprecation,
kAllowedInEnvvar); kAllowedInEnvvar);
@ -125,7 +125,7 @@ index 54b253aa54f5cdebdb04315f9c6c2506977555c0..acf390bd456c7ddfa6987e440fb45940
"show stack traces on deprecations", "show stack traces on deprecations",
&EnvironmentOptions::trace_deprecation, &EnvironmentOptions::trace_deprecation,
diff --git a/src/node_options.h b/src/node_options.h diff --git a/src/node_options.h b/src/node_options.h
index 065457acfde6ba4d04ed570cc72005cfd2798fd5..150f833bb21bd6d37f652f0785a4a98f3de5f67d 100644 index 60068b008b2e2a034c3f0c58b947a8d04d55e3b2..d821bc6a9adf28ea312a9c446f8acfc8ed586ae3 100644
--- a/src/node_options.h --- a/src/node_options.h
+++ b/src/node_options.h +++ b/src/node_options.h
@@ -203,7 +203,6 @@ class EnvironmentOptions : public Options { @@ -203,7 +203,6 @@ class EnvironmentOptions : public Options {

View file

@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
diff --git a/doc/api/cli.md b/doc/api/cli.md diff --git a/doc/api/cli.md b/doc/api/cli.md
index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065db73ff519 100644 index 6f984926a62973ba36bd3c27cc39b01f2bcac819..121d8f2bbd2b1d93067a06a902b1e7b986bcdb49 100644
--- a/doc/api/cli.md --- a/doc/api/cli.md
+++ b/doc/api/cli.md +++ b/doc/api/cli.md
@@ -3350,7 +3350,6 @@ V8 options that are allowed are: @@ -3404,7 +3404,6 @@ V8 options that are allowed are:
* `--disallow-code-generation-from-strings` * `--disallow-code-generation-from-strings`
* `--enable-etw-stack-walking` * `--enable-etw-stack-walking`
* `--expose-gc` * `--expose-gc`
@ -30,10 +30,10 @@ index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065d
* `--jitless` * `--jitless`
* `--max-old-space-size` * `--max-old-space-size`
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index b22fbb0a285f6f323779d6ebb2b027a3990b031e..54b253aa54f5cdebdb04315f9c6c2506977555c0 100644 index bb1e80ece4158dfed1b8bab7dc6d00dd56505aac..a9500716f2a955fc591628a969c5fba40783a2e7 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -984,11 +984,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( @@ -992,11 +992,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"disallow eval and friends", "disallow eval and friends",
V8Option{}, V8Option{},
kAllowedInEnvvar); kAllowedInEnvvar);

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. the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index 372409f4b09cc3b3be9809f697816498e5c021fe..f2a45f0f0bbfce93e61d3696a18425af4d022a00 100644 index 393fe32765794fbc5e92690e968e3c18f0d749fa..d9c0b721fe0a629a30efb3c4e04905176ca0a7f5 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -90,6 +90,23 @@ @@ -90,6 +90,23 @@

View file

@ -15,10 +15,10 @@ corresponding change.
CL: https://chromium-review.googlesource.com/c/v8/v8/+/5300826 CL: https://chromium-review.googlesource.com/c/v8/v8/+/5300826
diff --git a/src/node_platform.cc b/src/node_platform.cc diff --git a/src/node_platform.cc b/src/node_platform.cc
index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb41d12b97 100644 index 9c4c1e1db5fa7c0ca791e01d9be331e0957e9699..b438b3774d0aa7680fdbc6c6bf39a87893d221b2 100644
--- a/src/node_platform.cc --- a/src/node_platform.cc
+++ b/src/node_platform.cc +++ b/src/node_platform.cc
@@ -245,11 +245,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) { @@ -307,11 +307,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) {
platform_data->FlushForegroundTasksInternal(); platform_data->FlushForegroundTasksInternal();
} }
@ -31,10 +31,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb
-void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) { -void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) {
+void PerIsolatePlatformData::PostTaskImpl(std::unique_ptr<Task> task, +void PerIsolatePlatformData::PostTaskImpl(std::unique_ptr<Task> task,
+ const v8::SourceLocation& location) { + const v8::SourceLocation& location) {
if (flush_tasks_ == nullptr) { // The task can be posted from any V8 background worker thread, even when
// V8 may post tasks during Isolate disposal. In that case, the only // the foreground task runner is being cleaned up by Shutdown(). In that
// sensible path forward is to discard the task. // case, make sure we wait until the shutdown is completed (which leads
@@ -259,8 +261,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) { @@ -330,8 +332,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) {
uv_async_send(flush_tasks_); uv_async_send(flush_tasks_);
} }
@ -44,10 +44,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb
+ std::unique_ptr<Task> task, + std::unique_ptr<Task> task,
+ double delay_in_seconds, + double delay_in_seconds,
+ const v8::SourceLocation& location) { + const v8::SourceLocation& location) {
if (flush_tasks_ == nullptr) { if (debug_log_level_ != PlatformDebugLogLevel::kNone) {
// V8 may post tasks during Isolate disposal. In that case, the only fprintf(stderr,
// sensible path forward is to discard the task. "\nPerIsolatePlatformData::PostDelayedTaskImpl %p %f",
@@ -274,13 +278,15 @@ void PerIsolatePlatformData::PostDelayedTask( @@ -353,13 +357,15 @@ void PerIsolatePlatformData::PostDelayedTask(
uv_async_send(flush_tasks_); uv_async_send(flush_tasks_);
} }
@ -67,10 +67,10 @@ index 00ca9757bc4d0cdeb03a3f32be3ef19077cb7969..65a9b79ae6ac8b7589e8f8109a709acb
} }
diff --git a/src/node_platform.h b/src/node_platform.h diff --git a/src/node_platform.h b/src/node_platform.h
index 77cb5e6e4f891c510cdaf7fd6175a1f00d9bc420..dde2d1b5687a5b52a4f09183bb4ff88d7d3e4d01 100644 index af30ebeb0c8629ab86d1a55fd63610165abfbabf..a0222b4a1b074c6708e390d58d04221717069ac1 100644
--- a/src/node_platform.h --- a/src/node_platform.h
+++ b/src/node_platform.h +++ b/src/node_platform.h
@@ -59,18 +59,21 @@ class PerIsolatePlatformData : @@ -80,18 +80,21 @@ class PerIsolatePlatformData :
~PerIsolatePlatformData() override; ~PerIsolatePlatformData() override;
std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner() override; std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner() override;

View file

@ -44,10 +44,10 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480
let filename = call.getFileName(); let filename = call.getFileName();
const line = call.getLineNumber() - 1; const line = call.getLineNumber() - 1;
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index 23cb558a22b4462f5ce4f74833d25c7f712f8139..b22fbb0a285f6f323779d6ebb2b027a3990b031e 100644 index 8be78889e8234eb3100f309829bf7470db544dcd..bb1e80ece4158dfed1b8bab7dc6d00dd56505aac 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -1535,14 +1535,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) { @@ -1557,14 +1557,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
} }
Isolate* isolate = args.GetIsolate(); Isolate* isolate = args.GetIsolate();

View file

@ -12,10 +12,10 @@ This can be removed/refactored once Node.js upgrades to a version of V8
containing the above CL. containing the above CL.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 9f6fa646ba6673f67f5f625e157ed850633a26da..63a462876c00588d22abdd6ed8ee41ecf6590d03 100644 index bc670a6c8b5027417cdc35e1cd94a60f63fd342d..49a9670de72c222d6b4a681be001efb4a2651ea3 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1173,7 +1173,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1209,7 +1209,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
result->platform_ = per_process::v8_platform.Platform(); result->platform_ = per_process::v8_platform.Platform();
} }

View file

@ -33,7 +33,7 @@ index 49aacb6262502ced54e817f99dd596db85b9659c..f9f065bb743275e9b2ce71375e6a9f06
if (!loaded) { if (!loaded) {
module = new CJSModule(filename); module = new CJSModule(filename);
diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js
index ab4783a7982b9feb8fa85b62e3e3b181f93309bd..34f91026451d7347ae278712d083e4fe281e50f3 100644 index 02ba43adc2c8e92a78942bbb04023a16f5870ee9..bbf1ab69b884a9325bebdd07b2c4fd354eee946b 100644
--- a/lib/internal/modules/run_main.js --- a/lib/internal/modules/run_main.js
+++ b/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@

View file

@ -8,10 +8,10 @@ resource path. This commit ensures that the TraverseParent function
bails out if the parent path is outside of the resource path. bails out if the parent path is outside of the resource path.
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index 210a01d24e11764dc9fc37a77b354f11383693f8..4e9f70a1c41b44d2a1863b778d4f1e37279178d9 100644 index 55d628f0c5e7f330e548878807de26d51ef025b5..c06779dea471b6f6a8dd29d4657162ef0faec043 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -290,8 +290,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent( @@ -291,8 +291,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent(
Realm* realm, const std::filesystem::path& check_path) { Realm* realm, const std::filesystem::path& check_path) {
std::filesystem::path current_path = check_path; std::filesystem::path current_path = check_path;
auto env = realm->env(); auto env = realm->env();
@ -53,7 +53,7 @@ index 210a01d24e11764dc9fc37a77b354f11383693f8..4e9f70a1c41b44d2a1863b778d4f1e37
do { do {
current_path = current_path.parent_path(); current_path = current_path.parent_path();
@@ -310,6 +343,12 @@ const BindingData::PackageConfig* BindingData::TraverseParent( @@ -311,6 +344,12 @@ const BindingData::PackageConfig* BindingData::TraverseParent(
return nullptr; return nullptr;
} }

View file

@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules`
binding. binding.
diff --git a/src/env_properties.h b/src/env_properties.h diff --git a/src/env_properties.h b/src/env_properties.h
index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9b758fd3e 100644 index cbb7eab2df0416087cd3e6fb80eef2079143d9c8..7e9f5e977506149d69c6015e85d031770325e1da 100644
--- a/src/env_properties.h --- a/src/env_properties.h
+++ b/src/env_properties.h +++ b/src/env_properties.h
@@ -485,6 +485,7 @@ @@ -501,6 +501,7 @@
V(maybe_cache_generated_source_map, v8::Function) \ V(maybe_cache_generated_source_map, v8::Function) \
V(messaging_deserialize_create_object, v8::Function) \ V(messaging_deserialize_create_object, v8::Function) \
V(message_port, v8::Object) \ V(message_port, v8::Object) \
@ -20,7 +20,7 @@ index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9
V(performance_entry_callback, v8::Function) \ V(performance_entry_callback, v8::Function) \
V(prepare_stack_trace_callback, v8::Function) \ V(prepare_stack_trace_callback, v8::Function) \
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4088e05ac 100644 index c06779dea471b6f6a8dd29d4657162ef0faec043..6204986dc97686a248d6ae483f3a413ee5c51e47 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -21,6 +21,7 @@ namespace modules { @@ -21,6 +21,7 @@ namespace modules {
@ -31,7 +31,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
using v8::FunctionCallbackInfo; using v8::FunctionCallbackInfo;
using v8::HandleScope; using v8::HandleScope;
using v8::Isolate; using v8::Isolate;
@@ -88,6 +89,7 @@ Local<Array> BindingData::PackageConfig::Serialize(Realm* realm) const { @@ -89,6 +90,7 @@ Local<Array> BindingData::PackageConfig::Serialize(Realm* realm) const {
const BindingData::PackageConfig* BindingData::GetPackageJSON( const BindingData::PackageConfig* BindingData::GetPackageJSON(
Realm* realm, std::string_view path, ErrorContext* error_context) { Realm* realm, std::string_view path, ErrorContext* error_context) {
@ -39,7 +39,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
auto binding_data = realm->GetBindingData<BindingData>(); auto binding_data = realm->GetBindingData<BindingData>();
auto cache_entry = binding_data->package_configs_.find(path.data()); auto cache_entry = binding_data->package_configs_.find(path.data());
@@ -97,8 +99,36 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( @@ -98,8 +100,36 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
PackageConfig package_config{}; PackageConfig package_config{};
package_config.file_path = path; package_config.file_path = path;
@ -77,7 +77,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
return nullptr; return nullptr;
} }
// In some systems, std::string is annotated to generate an // In some systems, std::string is annotated to generate an
@@ -248,6 +278,12 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( @@ -249,6 +279,12 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
return &cached.first->second; return &cached.first->second;
} }
@ -90,7 +90,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
void BindingData::ReadPackageJSON(const FunctionCallbackInfo<Value>& args) { void BindingData::ReadPackageJSON(const FunctionCallbackInfo<Value>& args) {
CHECK_GE(args.Length(), 1); // path, [is_esm, base, specifier] CHECK_GE(args.Length(), 1); // path, [is_esm, base, specifier]
CHECK(args[0]->IsString()); // path CHECK(args[0]->IsString()); // path
@@ -556,6 +592,8 @@ void GetCompileCacheDir(const FunctionCallbackInfo<Value>& args) { @@ -643,6 +679,8 @@ void InitImportMetaPathHelpers(const FunctionCallbackInfo<Value>& args) {
void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data, void BindingData::CreatePerIsolateProperties(IsolateData* isolate_data,
Local<ObjectTemplate> target) { Local<ObjectTemplate> target) {
Isolate* isolate = isolate_data->isolate(); Isolate* isolate = isolate_data->isolate();
@ -99,7 +99,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON); SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON);
SetMethod(isolate, SetMethod(isolate,
target, target,
@@ -595,6 +633,8 @@ void BindingData::CreatePerContextProperties(Local<Object> target, @@ -685,6 +723,8 @@ void BindingData::CreatePerContextProperties(Local<Object> target,
void BindingData::RegisterExternalReferences( void BindingData::RegisterExternalReferences(
ExternalReferenceRegistry* registry) { ExternalReferenceRegistry* registry) {
@ -109,7 +109,7 @@ index 4e9f70a1c41b44d2a1863b778d4f1e37279178d9..c56a32885b8debbd5b95a2c11f3838d4
registry->Register(GetNearestParentPackageJSONType); registry->Register(GetNearestParentPackageJSONType);
registry->Register(GetNearestParentPackageJSON); registry->Register(GetNearestParentPackageJSON);
diff --git a/src/node_modules.h b/src/node_modules.h diff --git a/src/node_modules.h b/src/node_modules.h
index 17909b2270454b3275c7bf2e50d4b9b35673ecc8..3d5b0e3ac65524adfe221bfd6f85360dee1f0bee 100644 index eb2900d8f8385238f89a6dcc972a28e5fcb1d288..e28f38d98f4f8749048af135f0dcbe55aa69c4fe 100644
--- a/src/node_modules.h --- a/src/node_modules.h
+++ b/src/node_modules.h +++ b/src/node_modules.h
@@ -54,6 +54,8 @@ class BindingData : public SnapshotableObject { @@ -54,6 +54,8 @@ class BindingData : public SnapshotableObject {

View file

@ -17,20 +17,10 @@ Upstreams:
- https://github.com/nodejs/node/pull/39136 - https://github.com/nodejs/node/pull/39136
diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc
index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac4e767d90 100644 index 6f9406eecacb7411a2e84a7b51e60b726d1961f3..bffdb0259eeed7389adb54a8ff13a1ac4e767d90 100644
--- a/deps/ncrypto/ncrypto.cc --- a/deps/ncrypto/ncrypto.cc
+++ b/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc
@@ -11,9 +11,6 @@ @@ -786,7 +786,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) {
#if OPENSSL_VERSION_MAJOR >= 3
#include <openssl/provider.h>
#endif
-#ifdef OPENSSL_IS_BORINGSSL
-#include "dh-primes.h"
-#endif // OPENSSL_IS_BORINGSSL
namespace ncrypto {
namespace {
@@ -789,7 +786,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) {
bool ok = true; bool ok = true;
@ -39,7 +29,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
GENERAL_NAME* gen = sk_GENERAL_NAME_value(names, i); GENERAL_NAME* gen = sk_GENERAL_NAME_value(names, i);
if (i != 0) BIO_write(out.get(), ", ", 2); if (i != 0) BIO_write(out.get(), ", ", 2);
@@ -813,7 +810,7 @@ bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { @@ -810,7 +810,7 @@ bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) {
bool ok = true; bool ok = true;
@ -48,7 +38,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
ACCESS_DESCRIPTION* desc = sk_ACCESS_DESCRIPTION_value(descs, i); ACCESS_DESCRIPTION* desc = sk_ACCESS_DESCRIPTION_value(descs, i);
if (i != 0) BIO_write(out.get(), "\n", 1); if (i != 0) BIO_write(out.get(), "\n", 1);
@@ -955,13 +952,17 @@ BIOPointer X509View::getValidTo() const { @@ -952,13 +952,17 @@ BIOPointer X509View::getValidTo() const {
int64_t X509View::getValidToTime() const { int64_t X509View::getValidToTime() const {
struct tm tp; struct tm tp;
@ -67,7 +57,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
return PortableTimeGM(&tp); return PortableTimeGM(&tp);
} }
@@ -1236,7 +1237,11 @@ BIOPointer BIOPointer::NewMem() { @@ -1233,7 +1237,11 @@ BIOPointer BIOPointer::NewMem() {
} }
BIOPointer BIOPointer::NewSecMem() { BIOPointer BIOPointer::NewSecMem() {
@ -80,7 +70,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
} }
BIOPointer BIOPointer::New(const BIO_METHOD* method) { BIOPointer BIOPointer::New(const BIO_METHOD* method) {
@@ -1306,8 +1311,10 @@ BignumPointer DHPointer::FindGroup(const std::string_view name, @@ -1303,8 +1311,10 @@ BignumPointer DHPointer::FindGroup(const std::string_view name,
#define V(n, p) \ #define V(n, p) \
if (EqualNoCase(name, n)) return BignumPointer(p(nullptr)); if (EqualNoCase(name, n)) return BignumPointer(p(nullptr));
if (option != FindGroupOption::NO_SMALL_PRIMES) { if (option != FindGroupOption::NO_SMALL_PRIMES) {
@ -91,7 +81,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
V("modp5", BN_get_rfc3526_prime_1536); V("modp5", BN_get_rfc3526_prime_1536);
} }
V("modp14", BN_get_rfc3526_prime_2048); V("modp14", BN_get_rfc3526_prime_2048);
@@ -1383,11 +1390,13 @@ DHPointer::CheckPublicKeyResult DHPointer::checkPublicKey( @@ -1380,11 +1390,13 @@ DHPointer::CheckPublicKeyResult DHPointer::checkPublicKey(
int codes = 0; int codes = 0;
if (DH_check_pub_key(dh_.get(), pub_key.get(), &codes) != 1) if (DH_check_pub_key(dh_.get(), pub_key.get(), &codes) != 1)
return DHPointer::CheckPublicKeyResult::CHECK_FAILED; return DHPointer::CheckPublicKeyResult::CHECK_FAILED;
@ -106,7 +96,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
return DHPointer::CheckPublicKeyResult::INVALID; return DHPointer::CheckPublicKeyResult::INVALID;
} }
return CheckPublicKeyResult::NONE; return CheckPublicKeyResult::NONE;
@@ -2330,7 +2339,7 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { @@ -2327,7 +2339,7 @@ const std::string_view SSLPointer::getClientHelloAlpn() const {
const unsigned char* buf; const unsigned char* buf;
size_t len; size_t len;
size_t rem; size_t rem;
@ -115,7 +105,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
if (!SSL_client_hello_get0_ext( if (!SSL_client_hello_get0_ext(
get(), get(),
TLSEXT_TYPE_application_layer_protocol_negotiation, TLSEXT_TYPE_application_layer_protocol_negotiation,
@@ -2343,6 +2352,8 @@ const std::string_view SSLPointer::getClientHelloAlpn() const { @@ -2340,6 +2352,8 @@ const std::string_view SSLPointer::getClientHelloAlpn() const {
len = (buf[0] << 8) | buf[1]; len = (buf[0] << 8) | buf[1];
if (len + 2 != rem) return {}; if (len + 2 != rem) return {};
return reinterpret_cast<const char*>(buf + 3); return reinterpret_cast<const char*>(buf + 3);
@ -124,7 +114,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
} }
const std::string_view SSLPointer::getClientHelloServerName() const { const std::string_view SSLPointer::getClientHelloServerName() const {
@@ -2350,7 +2361,7 @@ const std::string_view SSLPointer::getClientHelloServerName() const { @@ -2347,7 +2361,7 @@ const std::string_view SSLPointer::getClientHelloServerName() const {
const unsigned char* buf; const unsigned char* buf;
size_t len; size_t len;
size_t rem; size_t rem;
@ -133,7 +123,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
if (!SSL_client_hello_get0_ext(get(), TLSEXT_TYPE_server_name, &buf, &rem) || if (!SSL_client_hello_get0_ext(get(), TLSEXT_TYPE_server_name, &buf, &rem) ||
rem <= 2) { rem <= 2) {
return {}; return {};
@@ -2366,6 +2377,8 @@ const std::string_view SSLPointer::getClientHelloServerName() const { @@ -2363,6 +2377,8 @@ const std::string_view SSLPointer::getClientHelloServerName() const {
len = (*(buf + 3) << 8) | *(buf + 4); len = (*(buf + 3) << 8) | *(buf + 4);
if (len + 2 > rem) return {}; if (len + 2 > rem) return {};
return reinterpret_cast<const char*>(buf + 5); return reinterpret_cast<const char*>(buf + 5);
@ -142,7 +132,7 @@ index ce2e7b384eb1987ddb081f79884fb8cb62ade60b..bffdb0259eeed7389adb54a8ff13a1ac
} }
std::optional<const std::string_view> SSLPointer::GetServerName( std::optional<const std::string_view> SSLPointer::GetServerName(
@@ -2399,8 +2412,11 @@ bool SSLPointer::isServer() const { @@ -2396,8 +2412,11 @@ bool SSLPointer::isServer() const {
EVPKeyPointer SSLPointer::getPeerTempKey() const { EVPKeyPointer SSLPointer::getPeerTempKey() const {
if (!ssl_) return {}; if (!ssl_) return {};
EVP_PKEY* raw_key = nullptr; EVP_PKEY* raw_key = nullptr;
@ -195,10 +185,10 @@ index 245a43920c7baf000ba63192a84a4c3fd219be7d..56a554175b805c1703f13d62041f8c80
# The location of simdutf - use the one from node's deps by default. # The location of simdutf - use the one from node's deps by default.
node_simdutf_path = "$node_path/deps/simdutf" node_simdutf_path = "$node_path/deps/simdutf"
diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc
index 1754d1f71b8adbcb584bfe4606e2a341836fb671..ac0f529e75c30add0708dc20470846f2f56e4b86 100644 index 2176fb6982484e2c42538478eeb4dd81c9d50ee1..c00d3616e08b00b1e0a3a29b2dbb5278e1e14fcc 100644
--- a/src/crypto/crypto_cipher.cc --- a/src/crypto/crypto_cipher.cc
+++ b/src/crypto/crypto_cipher.cc +++ b/src/crypto/crypto_cipher.cc
@@ -1033,7 +1033,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) { @@ -1027,7 +1027,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
if (EVP_PKEY_decrypt_init(ctx.get()) <= 0) { if (EVP_PKEY_decrypt_init(ctx.get()) <= 0) {
return ThrowCryptoError(env, ERR_get_error()); return ThrowCryptoError(env, ERR_get_error());
} }
@ -207,7 +197,7 @@ index 1754d1f71b8adbcb584bfe4606e2a341836fb671..ac0f529e75c30add0708dc20470846f2
int rsa_pkcs1_implicit_rejection = int rsa_pkcs1_implicit_rejection =
EVP_PKEY_CTX_ctrl_str(ctx.get(), "rsa_pkcs1_implicit_rejection", "1"); EVP_PKEY_CTX_ctrl_str(ctx.get(), "rsa_pkcs1_implicit_rejection", "1");
// From the doc -2 means that the option is not supported. // From the doc -2 means that the option is not supported.
@@ -1048,6 +1048,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) { @@ -1042,6 +1042,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
env, env,
"RSA_PKCS1_PADDING is no longer supported for private decryption"); "RSA_PKCS1_PADDING is no longer supported for private decryption");
} }
@ -565,10 +555,10 @@ index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d09
#if NODE_OPENSSL_HAS_QUIC #if NODE_OPENSSL_HAS_QUIC
#include <openssl/quic.h> #include <openssl/quic.h>
diff --git a/src/node_options.cc b/src/node_options.cc diff --git a/src/node_options.cc b/src/node_options.cc
index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f712f8139 100644 index 3fc8194475ec0e8a9047c1f3da5d120f25d66190..8be78889e8234eb3100f309829bf7470db544dcd 100644
--- a/src/node_options.cc --- a/src/node_options.cc
+++ b/src/node_options.cc +++ b/src/node_options.cc
@@ -6,7 +6,7 @@ @@ -7,7 +7,7 @@
#include "node_external_reference.h" #include "node_external_reference.h"
#include "node_internals.h" #include "node_internals.h"
#include "node_sea.h" #include "node_sea.h"
@ -578,7 +568,7 @@ index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f
#endif #endif
diff --git a/src/node_options.h b/src/node_options.h diff --git a/src/node_options.h b/src/node_options.h
index e68a41b60832c4b000e17dd15ce16c1bdaf4b54b..065457acfde6ba4d04ed570cc72005cfd2798fd5 100644 index 7d14f06370d936a3866f0d988123de9fe614ce09..60068b008b2e2a034c3f0c58b947a8d04d55e3b2 100644
--- a/src/node_options.h --- a/src/node_options.h
+++ b/src/node_options.h +++ b/src/node_options.h
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@

View file

@ -48,7 +48,7 @@ index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18
static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual)); static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual));
diff --git a/src/node_buffer.cc b/src/node_buffer.cc diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee4d8ef8f0 100644 index 5bdffc0a4d7f8f643343593a543f2064b670c1b9..6931404b75dbe17bf3c7b561430b8d7c0921d085 100644
--- a/src/node_buffer.cc --- a/src/node_buffer.cc
+++ b/src/node_buffer.cc +++ b/src/node_buffer.cc
@@ -44,6 +44,14 @@ @@ -44,6 +44,14 @@
@ -74,7 +74,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee
using v8::FunctionCallbackInfo; using v8::FunctionCallbackInfo;
using v8::Global; using v8::Global;
using v8::HandleScope; using v8::HandleScope;
@@ -586,19 +593,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) { @@ -584,19 +591,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
// Assume caller has properly validated args. // Assume caller has properly validated args.
uint32_t FastCopy(Local<Value> receiver, uint32_t FastCopy(Local<Value> receiver,
@ -107,7 +107,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee
return to_copy; return to_copy;
} }
@@ -867,19 +879,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) { @@ -865,19 +877,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
} }
int32_t FastCompare(v8::Local<v8::Value>, int32_t FastCompare(v8::Local<v8::Value>,
@ -135,7 +135,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee
} }
static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare)); static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare));
@@ -1150,14 +1160,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) { @@ -1148,14 +1158,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
} }
int32_t FastIndexOfNumber(v8::Local<v8::Value>, int32_t FastIndexOfNumber(v8::Local<v8::Value>,
@ -153,7 +153,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee
} }
static v8::CFunction fast_index_of_number( static v8::CFunction fast_index_of_number(
@@ -1511,21 +1520,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) { @@ -1495,21 +1504,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) {
template <encoding encoding> template <encoding encoding>
uint32_t FastWriteString(Local<Value> receiver, uint32_t FastWriteString(Local<Value> receiver,
@ -192,7 +192,7 @@ index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee
+ std::min<uint32_t>(dst_size - offset, max_length)); + std::min<uint32_t>(dst_size - offset, max_length));
} }
static v8::CFunction fast_write_string_ascii( static const v8::CFunction fast_write_string_ascii(
diff --git a/src/node_external_reference.h b/src/node_external_reference.h diff --git a/src/node_external_reference.h b/src/node_external_reference.h
index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644 index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644
--- a/src/node_external_reference.h --- a/src/node_external_reference.h
@ -246,10 +246,10 @@ index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d4
// This class manages the external references from the V8 heap // This class manages the external references from the V8 heap
// to the C++ addresses in Node.js. // to the C++ addresses in Node.js.
diff --git a/src/util.h b/src/util.h diff --git a/src/util.h b/src/util.h
index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521ff68e32cd 100644 index a77332f583402af956cc886fd5b9771390cc4827..f0d7571caa458a3f9a9c252a95f72eb5fbddd06d 100644
--- a/src/util.h --- a/src/util.h
+++ b/src/util.h +++ b/src/util.h
@@ -59,6 +59,7 @@ @@ -60,6 +60,7 @@
namespace node { namespace node {
constexpr char kPathSeparator = std::filesystem::path::preferred_separator; constexpr char kPathSeparator = std::filesystem::path::preferred_separator;
@ -257,7 +257,7 @@ index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521f
#ifdef _WIN32 #ifdef _WIN32
/* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */ /* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */
@@ -584,6 +585,16 @@ class BufferValue : public MaybeStackBuffer<char> { @@ -585,6 +586,16 @@ class BufferValue : public MaybeStackBuffer<char> {
static_cast<char*>(name->Buffer()->Data()) + name##_offset; \ static_cast<char*>(name->Buffer()->Data()) + name##_offset; \
if (name##_length > 0) CHECK_NE(name##_data, nullptr); if (name##_length > 0) CHECK_NE(name##_data, nullptr);

View file

@ -11,10 +11,10 @@ This patch can be removed when we upgrade to a V8 version that
contains the above CL. contains the above CL.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index a0f1deadfc58f18f23467889680219360386f9dd..8da5f5344051663f92d72848fbac9d041ac4fac3 100644 index 0fbcd55d674b1d0cae88f04fe337cfcca702255f..092b1c525c7d4d50a09f99dc088d0698afcaf8a6 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -808,7 +808,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args, @@ -814,7 +814,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
} }
// TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default // TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default
// anymore. // anymore.

View file

@ -6,7 +6,7 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 33385fa792b71ea3802904dd3c59ce845342c595..92b368394e17a9257578cd5b7422391689732d6d 100644 index ccd2b4ced3134d81ddd37b8b5b90218457633421..a19fc5e52109bf2ad63fbe554c02a458c3096081 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -200,6 +200,13 @@ const { @@ -200,6 +200,13 @@ const {

View file

@ -18,10 +18,10 @@ This can be removed when Node.js upgrades to a version of V8 containing CLs
from the above issue. from the above issue.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 7f4f233b26425493a58ce71dfc0c3a92b7c0bef8..c3f422c6b212bf737a906d2a89df85b63c218617 100644 index 5b7f6e0609c8414c686d2d5ca603ea5c8bc484d0..6c9c81ff3c08fc28dc35578229a785521322b5dc 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -312,6 +312,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params, @@ -313,6 +313,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params,
MultiIsolatePlatform* platform, MultiIsolatePlatform* platform,
const SnapshotData* snapshot_data, const SnapshotData* snapshot_data,
const IsolateSettings& settings) { const IsolateSettings& settings) {
@ -32,7 +32,7 @@ index 7f4f233b26425493a58ce71dfc0c3a92b7c0bef8..c3f422c6b212bf737a906d2a89df85b6
Isolate* isolate = Isolate::Allocate(); Isolate* isolate = Isolate::Allocate();
if (isolate == nullptr) return nullptr; if (isolate == nullptr) return nullptr;
@@ -355,9 +359,12 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator, @@ -356,9 +360,12 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator,
uv_loop_t* event_loop, uv_loop_t* event_loop,
MultiIsolatePlatform* platform, MultiIsolatePlatform* platform,
const EmbedderSnapshotData* snapshot_data, const EmbedderSnapshotData* snapshot_data,
@ -102,36 +102,44 @@ index 9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f..c429eecd937d1df32a2ff90bc0a22a2e
worker::Worker* worker_context_ = nullptr; worker::Worker* worker_context_ = nullptr;
PerIsolateWrapperData* wrapper_data_; PerIsolateWrapperData* wrapper_data_;
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 8da5f5344051663f92d72848fbac9d041ac4fac3..2f58a6fa69069dabb99b5ddb8011991b07fa5f02 100644 index 092b1c525c7d4d50a09f99dc088d0698afcaf8a6..6f8f6386d0db8aef1e2e0126cc9064101cbe6112 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1222,10 +1222,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1258,6 +1258,14 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
result->platform_ = per_process::v8_platform.Platform(); result->platform_ = per_process::v8_platform.Platform();
} }
- if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) { + if (!(flags & ProcessInitializationFlags::kNoInitializeCppgc)) {
- V8::Initialize(); + v8::PageAllocator* allocator = nullptr;
- } + if (result->platform_ != nullptr) {
- + allocator = result->platform_->GetPageAllocator();
if (!(flags & ProcessInitializationFlags::kNoInitializeCppgc)) { + }
v8::PageAllocator* allocator = nullptr; + cppgc::InitializeProcess(allocator);
if (result->platform_ != nullptr) {
@@ -1234,6 +1230,10 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
cppgc::InitializeProcess(allocator);
}
+ if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
+ V8::Initialize();
+ } + }
+ +
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
V8::Initialize();
@@ -1267,14 +1275,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
}
- if (!(flags & ProcessInitializationFlags::kNoInitializeCppgc)) {
- v8::PageAllocator* allocator = nullptr;
- if (result->platform_ != nullptr) {
- allocator = result->platform_->GetPageAllocator();
- }
- cppgc::InitializeProcess(allocator);
- }
-
#if NODE_USE_V8_WASM_TRAP_HANDLER #if NODE_USE_V8_WASM_TRAP_HANDLER
bool use_wasm_trap_handler = bool use_wasm_trap_handler =
!per_process::cli_options->disable_wasm_trap_handler; !per_process::cli_options->disable_wasm_trap_handler;
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index 98ad0ea649eaef43d1f5231f7bc4044e100e08d7..c295cce8f5c7965cce4d2e4c0614dbe076986a4c 100644 index 42d55d24bd0770795ae0c0e19241d25a6350ae08..4335c7cf53b7e08c95dcee3461384ac12c8ebe41 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -589,7 +589,8 @@ NODE_EXTERN v8::Isolate* NewIsolate( @@ -590,7 +590,8 @@ NODE_EXTERN v8::Isolate* NewIsolate(
struct uv_loop_s* event_loop, struct uv_loop_s* event_loop,
MultiIsolatePlatform* platform, MultiIsolatePlatform* platform,
const EmbedderSnapshotData* snapshot_data = nullptr, const EmbedderSnapshotData* snapshot_data = nullptr,
@ -166,7 +174,7 @@ index 4119ac1b002681d39711eac810ca2fcc2702ffc7..790347056cde949ffe6cf8498a7eca0c
ExitCode NodeMainInstance::Run() { ExitCode NodeMainInstance::Run() {
diff --git a/src/node_worker.cc b/src/node_worker.cc diff --git a/src/node_worker.cc b/src/node_worker.cc
index 1fc3774948dae3c0aae7d2aef563e18ecd4243a3..9d35cbf3dff538f38e8d5b8660d40c1fbaa56474 100644 index 9d56d8f793ef48a79867f465530554ae0226f2cd..842eb999c6ef0cb877cc2ee4acf75bb597a117da 100644
--- a/src/node_worker.cc --- a/src/node_worker.cc
+++ b/src/node_worker.cc +++ b/src/node_worker.cc
@@ -162,6 +162,9 @@ class WorkerThreadData { @@ -162,6 +162,9 @@ class WorkerThreadData {
@ -195,7 +203,7 @@ index 1fc3774948dae3c0aae7d2aef563e18ecd4243a3..9d35cbf3dff538f38e8d5b8660d40c1f
// Wait until the platform has cleaned up all relevant resources. // Wait until the platform has cleaned up all relevant resources.
while (!platform_finished) { while (!platform_finished) {
diff --git a/src/util.cc b/src/util.cc diff --git a/src/util.cc b/src/util.cc
index 3e9dfb4392fb3e3deaab5506771f01be65bc5dda..416e0479ddf740c6d3e2d4ea9466ac060b038294 100644 index 0c01d338b9d1ced7f173ac862239315f91326791..5ca32f026f9f001ddadc14965705fe005600eddd 100644
--- a/src/util.cc --- a/src/util.cc
+++ b/src/util.cc +++ b/src/util.cc
@@ -726,8 +726,8 @@ RAIIIsolateWithoutEntering::RAIIIsolateWithoutEntering(const SnapshotData* data) @@ -726,8 +726,8 @@ RAIIIsolateWithoutEntering::RAIIIsolateWithoutEntering(const SnapshotData* data)

View file

@ -161,10 +161,10 @@ index cfe917c797a6e4bb0f0284ec56be82637f840129..9f1c7ef45b6df10f811936a78ea6d9fc
inline MultiIsolatePlatform* platform() const; inline MultiIsolatePlatform* platform() const;
inline const SnapshotData* snapshot_data() const; inline const SnapshotData* snapshot_data() const;
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index bdc77f8eb7abffa9e6c98cd254daedad3e44b981..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644 index 174fd4d1af4c8cd75aec09f4548a674fd5539fb2..42d55d24bd0770795ae0c0e19241d25a6350ae08 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -1553,24 +1553,14 @@ void RegisterSignalHandler(int signal, @@ -1560,24 +1560,14 @@ void RegisterSignalHandler(int signal,
bool reset_handler = false); bool reset_handler = false);
#endif // _WIN32 #endif // _WIN32

View file

@ -26,7 +26,7 @@ index 3d8ccc77b5952a999c5fe48792259d32b402c460..867a1c4aca54b9d41490d23a5eb55088
} }
diff --git a/src/histogram.cc b/src/histogram.cc diff --git a/src/histogram.cc b/src/histogram.cc
index 0f0cde7be431dcb80c5314b1a9da49886c436d1c..f6d2bd439cad8b9f91c9d9a6cdb302e64130a5e2 100644 index 5641990e0bac455c33ddf7b9a865deba871516e7..bd757f42e02391abbeec007d9c4cea60bcdfa6a4 100644
--- a/src/histogram.cc --- a/src/histogram.cc
+++ b/src/histogram.cc +++ b/src/histogram.cc
@@ -195,7 +195,8 @@ void HistogramBase::FastRecord(Local<Value> unused, @@ -195,7 +195,8 @@ void HistogramBase::FastRecord(Local<Value> unused,

View file

@ -7,10 +7,10 @@ This refactors several allocators to allocate within the V8 memory cage,
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature. allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 88c2c932a6b045317c83c911b1cd8267b60d9334..7f4f233b26425493a58ce71dfc0c3a92b7c0bef8 100644 index df5fb942aa893c22d14d7eb21a5211a46a472a5f..5b7f6e0609c8414c686d2d5ca603ea5c8bc484d0 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -102,6 +102,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context, @@ -103,6 +103,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
return result; return result;
} }
@ -156,7 +156,7 @@ index 1592134716da2de40de4ba028ee937b765423e37..8f3ba65f1fef2c066d6df6087a08ba71
v8::Local<v8::ArrayBuffer> ToArrayBuffer(Environment* env); v8::Local<v8::ArrayBuffer> ToArrayBuffer(Environment* env);
diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc
index 3465454e4de4a78912b81e7eca0de395fbe89911..c8ae863460107c69dd77d67c76c11843114e99c4 100644 index f616223cfb0f6e10f7cf57ada9704316bde2797e..eb6dad44a49d997097c8fb5009eeb60a7305da27 100644
--- a/src/crypto/crypto_x509.cc --- a/src/crypto/crypto_x509.cc
+++ b/src/crypto/crypto_x509.cc +++ b/src/crypto/crypto_x509.cc
@@ -167,6 +167,19 @@ MaybeLocal<Value> ToV8Value(Local<Context> context, const BIOPointer& bio) { @@ -167,6 +167,19 @@ MaybeLocal<Value> ToV8Value(Local<Context> context, const BIOPointer& bio) {
@ -229,10 +229,10 @@ index ea7810e41e2667713a896250dc1b904b0a7cf198..865b3128c1edfe7074769f25a0b87878
constexpr const char* EncodingName(const enum encoding encoding) { constexpr const char* EncodingName(const enum encoding encoding) {
diff --git a/src/node_internals.h b/src/node_internals.h diff --git a/src/node_internals.h b/src/node_internals.h
index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f3350b787 100644 index 275534285ec28f02b46639142ab4195b24267476..5f9d123f9d4b9feb7bc0b627b1e6309fdbd6e30d 100644
--- a/src/node_internals.h --- a/src/node_internals.h
+++ b/src/node_internals.h +++ b/src/node_internals.h
@@ -117,7 +117,9 @@ v8::Maybe<void> InitializePrimordials(v8::Local<v8::Context> context); @@ -120,7 +120,9 @@ v8::MaybeLocal<v8::Object> InitializePrivateSymbols(
class NodeArrayBufferAllocator : public ArrayBufferAllocator { class NodeArrayBufferAllocator : public ArrayBufferAllocator {
public: public:
@ -243,7 +243,7 @@ index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f
void* Allocate(size_t size) override; // Defined in src/node.cc void* Allocate(size_t size) override; // Defined in src/node.cc
void* AllocateUninitialized(size_t size) override; void* AllocateUninitialized(size_t size) override;
@@ -135,7 +137,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator { @@ -138,7 +140,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
} }
private: private:

View file

@ -1,50 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeroen Hofstee <jhofstee@victronenergy.com>
Date: Tue, 1 Apr 2025 20:09:31 +0000
Subject: zlib: fix pointer alignment
The function AllocForBrotli prefixes the allocated memory with its
size, and returns a pointer to the region after it. This pointer can
however no longer be suitably aligned. Correct this by allocating
the maximum of the the size of the size_t and the max alignment.
On Arm 32bits the size_t is 4 bytes long, but the alignment is 8 for
some NEON instructions. When Brotli is compiled with optimizations
enabled newer GCC versions will use the NEON instructions and trigger
a bus error killing node.
see https://github.com/google/brotli/issues/1159
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index 0b7c47b326c7c5480086228b3d40d54c260ef16a..7e6b38ecd1aa360012c0d73e94412530a48cb8c3 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -608,7 +608,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
}
static void* AllocForBrotli(void* data, size_t size) {
- size += sizeof(size_t);
+ constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t));
+ size += offset;
CompressionStream* ctx = static_cast<CompressionStream*>(data);
char* memory = UncheckedMalloc(size);
if (memory == nullptr) [[unlikely]] {
@@ -617,7 +618,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
*reinterpret_cast<size_t*>(memory) = size;
ctx->unreported_allocations_.fetch_add(size,
std::memory_order_relaxed);
- return memory + sizeof(size_t);
+ return memory + offset;
}
static void FreeForZlib(void* data, void* pointer) {
@@ -625,7 +626,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
return;
}
CompressionStream* ctx = static_cast<CompressionStream*>(data);
- char* real_pointer = static_cast<char*>(pointer) - sizeof(size_t);
+ constexpr size_t offset = std::max(sizeof(size_t), alignof(max_align_t));
+ char* real_pointer = static_cast<char*>(pointer) - offset;
size_t real_size = *reinterpret_cast<size_t*>(real_pointer);
ctx->unreported_allocations_.fetch_sub(real_size,
std::memory_order_relaxed);

View file

@ -7,6 +7,7 @@
"parallel/test-code-cache", "parallel/test-code-cache",
"parallel/test-cluster-primary-error", "parallel/test-cluster-primary-error",
"parallel/test-cluster-primary-kill", "parallel/test-cluster-primary-kill",
"parallel/test-config-file",
"parallel/test-crypto-aes-wrap", "parallel/test-crypto-aes-wrap",
"parallel/test-crypto-authenticated", "parallel/test-crypto-authenticated",
"parallel/test-crypto-authenticated-stream", "parallel/test-crypto-authenticated-stream",
@ -72,6 +73,7 @@
"parallel/test-snapshot-weak-reference", "parallel/test-snapshot-weak-reference",
"parallel/test-snapshot-worker", "parallel/test-snapshot-worker",
"parallel/test-strace-openat-openssl", "parallel/test-strace-openat-openssl",
"parallel/test-sqlite-backup",
"parallel/test-tls-alpn-server-client", "parallel/test-tls-alpn-server-client",
"parallel/test-tls-cli-min-version-1.0", "parallel/test-tls-cli-min-version-1.0",
"parallel/test-tls-cli-max-version-1.2", "parallel/test-tls-cli-max-version-1.2",

View file

@ -1001,11 +1001,10 @@ void OnNodePreload(node::Environment* env,
} }
// Execute lib/node/init.ts. // Execute lib/node/init.ts.
std::vector<v8::Local<v8::String>> bundle_params = { v8::LocalVector<v8::String> bundle_params(
node::FIXED_ONE_BYTE_STRING(env->isolate(), "process"), env->isolate(), {node::FIXED_ONE_BYTE_STRING(env->isolate(), "process"),
node::FIXED_ONE_BYTE_STRING(env->isolate(), "require"), node::FIXED_ONE_BYTE_STRING(env->isolate(), "require")});
}; v8::LocalVector<v8::Value> bundle_args(env->isolate(), {process, require});
std::vector<v8::Local<v8::Value>> bundle_args = {process, require};
electron::util::CompileAndCall(env->context(), "electron/js2c/node_init", electron::util::CompileAndCall(env->context(), "electron/js2c/node_init",
&bundle_params, &bundle_args); &bundle_params, &bundle_args);
} }

View file

@ -23,8 +23,8 @@ namespace electron::util {
v8::MaybeLocal<v8::Value> CompileAndCall( v8::MaybeLocal<v8::Value> CompileAndCall(
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
const char* id, const char* id,
std::vector<v8::Local<v8::String>>* parameters, v8::LocalVector<v8::String>* parameters,
std::vector<v8::Local<v8::Value>>* arguments) { v8::LocalVector<v8::Value>* arguments) {
v8::Isolate* isolate = context->GetIsolate(); v8::Isolate* isolate = context->GetIsolate();
v8::TryCatch try_catch(isolate); v8::TryCatch try_catch(isolate);

View file

@ -53,8 +53,8 @@ void EmitDeprecationWarning(std::string_view warning_msg,
v8::MaybeLocal<v8::Value> CompileAndCall( v8::MaybeLocal<v8::Value> CompileAndCall(
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
const char* id, const char* id,
std::vector<v8::Local<v8::String>>* parameters, v8::LocalVector<v8::String>* parameters,
std::vector<v8::Local<v8::Value>>* arguments); v8::LocalVector<v8::Value>* arguments);
// Wrapper for node::CreateEnvironment that logs failure // Wrapper for node::CreateEnvironment that logs failure
node::Environment* CreateEnvironment(v8::Isolate* isolate, node::Environment* CreateEnvironment(v8::Isolate* isolate,

View file

@ -124,10 +124,10 @@ void ElectronSandboxedRendererClient::DidCreateScriptContext(
auto binding = v8::Object::New(isolate); auto binding = v8::Object::New(isolate);
InitializeBindings(binding, context, render_frame); InitializeBindings(binding, context, render_frame);
std::vector<v8::Local<v8::String>> sandbox_preload_bundle_params = { v8::LocalVector<v8::String> sandbox_preload_bundle_params(
node::FIXED_ONE_BYTE_STRING(isolate, "binding")}; isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "binding")});
std::vector<v8::Local<v8::Value>> sandbox_preload_bundle_args = {binding}; v8::LocalVector<v8::Value> sandbox_preload_bundle_args(isolate, {binding});
util::CompileAndCall( util::CompileAndCall(
isolate->GetCurrentContext(), "electron/js2c/sandbox_bundle", isolate->GetCurrentContext(), "electron/js2c/sandbox_bundle",

View file

@ -176,10 +176,10 @@ class PreloadRealmLifetimeController
process.SetReadOnly("type", "service-worker"); process.SetReadOnly("type", "service-worker");
process.SetReadOnly("contextIsolated", true); process.SetReadOnly("contextIsolated", true);
std::vector<v8::Local<v8::String>> preload_realm_bundle_params = { v8::LocalVector<v8::String> preload_realm_bundle_params(
node::FIXED_ONE_BYTE_STRING(isolate, "binding")}; isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "binding")});
std::vector<v8::Local<v8::Value>> preload_realm_bundle_args = {binding}; v8::LocalVector<v8::Value> preload_realm_bundle_args(isolate, {binding});
util::CompileAndCall(context, "electron/js2c/preload_realm_bundle", util::CompileAndCall(context, "electron/js2c/preload_realm_bundle",
&preload_realm_bundle_params, &preload_realm_bundle_params,

View file

@ -597,11 +597,11 @@ void RendererClientBase::SetupMainWorldOverrides(
} }
} }
std::vector<v8::Local<v8::String>> isolated_bundle_params = { v8::LocalVector<v8::String> isolated_bundle_params(
node::FIXED_ONE_BYTE_STRING(isolate, "isolatedApi")}; isolate, {node::FIXED_ONE_BYTE_STRING(isolate, "isolatedApi")});
std::vector<v8::Local<v8::Value>> isolated_bundle_args = { v8::LocalVector<v8::Value> isolated_bundle_args(isolate,
isolated_api.GetHandle()}; {isolated_api.GetHandle()});
util::CompileAndCall(context, "electron/js2c/isolated_bundle", util::CompileAndCall(context, "electron/js2c/isolated_bundle",
&isolated_bundle_params, &isolated_bundle_args); &isolated_bundle_params, &isolated_bundle_args);