diff --git a/DEPS b/DEPS index 135095764539..2d26ec630527 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '136.0.7103.49', 'node_version': - 'v22.14.0', + 'v22.15.0', 'nan_version': 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': diff --git a/patches/chromium/build_allow_electron_to_use_exec_script.patch b/patches/chromium/build_allow_electron_to_use_exec_script.patch index 31c3790c8525..e79b8783f03f 100644 --- a/patches/chromium/build_allow_electron_to_use_exec_script.patch +++ b/patches/chromium/build_allow_electron_to_use_exec_script.patch @@ -6,10 +6,10 @@ Subject: build: allow electron to use exec_script This is similar to the //build usecase so we're OK adding ourselves here diff --git a/.gn b/.gn -index 54d2631ec203207f44038a36439613709fec1669..c8b8f604f9e9d960e8144a93d958ab125aae96c5 100644 +index 54d2631ec203207f44038a36439613709fec1669..d7e197dc75dd711b1b2eb179a58de9030bde0465 100644 --- a/.gn +++ b/.gn -@@ -173,4 +173,26 @@ exec_script_allowlist = +@@ -173,4 +173,27 @@ exec_script_allowlist = "//tools/grit/grit_rule.gni", "//tools/gritsettings/BUILD.gn", @@ -34,5 +34,6 @@ index 54d2631ec203207f44038a36439613709fec1669..c8b8f604f9e9d960e8144a93d958ab12 + "//third_party/electron_node/deps/sqlite/unofficial.gni", + "//third_party/electron_node/deps/uv/unofficial.gni", + "//third_party/electron_node/deps/uvwasi/unofficial.gni", ++ "//third_party/electron_node/deps/zstd/unofficial.gni", + "//third_party/electron_node/src/inspector/unofficial.gni", ] diff --git a/patches/node/.patches b/patches/node/.patches index 7e230586f067..7b326ff7bbbd 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -38,14 +38,10 @@ build_use_third_party_simdutf.patch fix_remove_fastapitypedarray_usage.patch test_handle_explicit_resource_management_globals.patch linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch -build_remove_explicit_linker_call_to_libm_on_macos.patch build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch -test_make_eval_snapshot_tests_more_flexible.patch build_option_to_use_custom_inspector_protocol_path.patch fix_adjust_wpt_and_webidl_tests_for_enabled_float16array.patch chore_add_createexternalizabletwobytestring_to_globals.patch -feat_add_oom_error_callback_in_node_isolatesettings.patch -fix_-wnonnull_warning.patch refactor_attach_cppgc_heap_on_v8_isolate_creation.patch fix_ensure_traverseparent_bails_on_resource_path_exit.patch cli_move_--trace-atomics-wait_to_eol.patch diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 7076c3671a84..d1d2ec6d8a63 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -54,71 +54,11 @@ index a2123cc6c6d21c53fafc8934203b3720393e7b11..245a43920c7baf000ba63192a84a4c3f } assert(!node_enable_inspector || node_use_openssl, -diff --git a/src/inspector/unofficial.gni b/src/inspector/unofficial.gni -index 5d87f3c901ab509e534598ed1eb0796a96355b5e..3d7aa148678b2646b88fa7c32abec91791b02b82 100644 ---- a/src/inspector/unofficial.gni -+++ b/src/inspector/unofficial.gni -@@ -13,7 +13,7 @@ template("inspector_gn_build") { - } - - node_gen_dir = get_label_info("../..", "target_gen_dir") -- protocol_tool_path = "../../tools/inspector_protocol" -+ protocol_tool_path = "../../deps/inspector_protocol" - - gypi_values = exec_script( - "../../tools/gypi_to_gn.py", -@@ -35,6 +35,8 @@ template("inspector_gn_build") { - ] - - args = [ -+ "--inspector_protocol_dir", -+ rebase_path(protocol_tool_path, root_build_dir), - "--jinja_dir", - # jinja is in third_party. - rebase_path("//third_party/", root_build_dir), -@@ -72,4 +74,37 @@ template("inspector_gn_build") { - outputs = [ "$node_gen_dir/src/{{source_name_part}}.json" ] - args = [ "{{source}}" ] + rebase_path(outputs, root_build_dir) - } -+ -+ config("crdtp_config") { -+ include_dirs = [ protocol_tool_path ] -+ } -+ -+ static_library("crdtp") { -+ public_configs = [ ":crdtp_config" ] -+ sources = [ -+ "$protocol_tool_path/crdtp/cbor.cc", -+ "$protocol_tool_path/crdtp/cbor.h", -+ "$protocol_tool_path/crdtp/dispatch.cc", -+ "$protocol_tool_path/crdtp/dispatch.h", -+ "$protocol_tool_path/crdtp/error_support.cc", -+ "$protocol_tool_path/crdtp/error_support.h", -+ "$protocol_tool_path/crdtp/export.h", -+ "$protocol_tool_path/crdtp/find_by_first.h", -+ "$protocol_tool_path/crdtp/frontend_channel.h", -+ "$protocol_tool_path/crdtp/glue.h", -+ "$protocol_tool_path/crdtp/json.cc", -+ "$protocol_tool_path/crdtp/json.h", -+ "$protocol_tool_path/crdtp/parser_handler.h", -+ "$protocol_tool_path/crdtp/protocol_core.cc", -+ "$protocol_tool_path/crdtp/protocol_core.h", -+ "$protocol_tool_path/crdtp/serializable.cc", -+ "$protocol_tool_path/crdtp/serializable.h", -+ "$protocol_tool_path/crdtp/span.cc", -+ "$protocol_tool_path/crdtp/span.h", -+ "$protocol_tool_path/crdtp/status.cc", -+ "$protocol_tool_path/crdtp/status.h", -+ "$protocol_tool_path/crdtp/json_platform.cc", -+ "$protocol_tool_path/crdtp/json_platform.h", -+ ] -+ } - } diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 894fd515202cc3a1f933c2bbc618dd09869ad904..4f1ed661e9c432f3b50f2e7e348ad9794ff773d0 100644 +index e85860de93dd5753dd4542ecee9f0888af93898a..04eab49c368c8f86837ed2c1384bf3c63e4bde24 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -781,6 +781,7 @@ void BuiltinLoader::RegisterExternalReferences( +@@ -783,6 +783,7 @@ void BuiltinLoader::RegisterExternalReferences( registry->Register(GetNatives); RegisterExternalReferencesForInternalizedBuiltinCode(registry); @@ -306,7 +246,7 @@ index 21992cbe894a880e3223c379326b62db22f2f12d..1296a5457422099035ba34f2b02624f2 } // namespace js2c } // namespace node diff --git a/tools/search_files.py b/tools/search_files.py -index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d1e877e03 100755 +index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd17a16c20b 100755 --- a/tools/search_files.py +++ b/tools/search_files.py @@ -14,6 +14,7 @@ if __name__ == '__main__': @@ -314,14 +254,19 @@ index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d files = SearchFiles(*sys.argv[2:]) files = [ os.path.relpath(x, sys.argv[1]) for x in files ] + files = [os.path.normpath(x).replace(os.sep, '/') for x in files] - print('\n'.join(files)) - except Exception as e: - print(str(e)) + # Apply the same transform in SearchFiles after relpath + if sys.platform == 'win32': + files = [ x.replace('\\', '/') for x in files ] diff --git a/unofficial.gni b/unofficial.gni -index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5aeab1340d 100644 +index 44641b92678ab2f28e6f5de75a92878f9f3d322d..672e97436d9220e8d5046b0c92025f50ae50a3d8 100644 --- a/unofficial.gni +++ b/unofficial.gni -@@ -145,6 +145,7 @@ template("node_gn_build") { +@@ -142,32 +142,39 @@ template("node_gn_build") { + public_configs = [ + ":node_external_config", + "deps/googletest:googletest_config", ++ ":zstd_include_config" + ] public_deps = [ "deps/ada", "deps/uv", @@ -329,7 +274,11 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a "deps/simdjson", "$node_v8_path", ] -@@ -156,7 +157,6 @@ template("node_gn_build") { + deps = [ + ":run_node_js2c", +- "deps/brotli", + "deps/cares", + "deps/histogram", "deps/llhttp", "deps/nbytes", "deps/nghttp2", @@ -337,7 +286,13 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a "deps/postject", "deps/sqlite", "deps/uvwasi", -@@ -165,7 +165,11 @@ template("node_gn_build") { +- "deps/zstd", + "//third_party/zlib", ++ "//third_party/brotli:dec", ++ "//third_party/brotli:enc", ++ "//third_party/zstd:decompress", ++ "//third_party/zstd:headers", + "$node_simdutf_path", "$node_v8_path:v8_libplatform", ] @@ -349,7 +304,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a "$target_gen_dir/node_javascript.cc", ] + gypi_values.node_sources -@@ -185,11 +189,12 @@ template("node_gn_build") { +@@ -190,7 +197,7 @@ template("node_gn_build") { } if (node_use_openssl) { deps += [ "deps/ncrypto" ] @@ -358,12 +313,18 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a sources += gypi_values.node_crypto_sources } if (node_enable_inspector) { - deps += [ -+ "src/inspector:crdtp", - "src/inspector:node_protocol_generated_sources", - "src/inspector:v8_inspector_compress_protocol_json", - ] -@@ -282,6 +287,7 @@ template("node_gn_build") { +@@ -214,6 +221,10 @@ template("node_gn_build") { + } + } + ++ config("zstd_include_config") { ++ include_dirs = [ "//third_party/zstd/src/lib" ] ++ } ++ + executable(target_name) { + forward_variables_from(invoker, "*") + +@@ -288,6 +299,7 @@ template("node_gn_build") { } executable("node_js2c") { @@ -371,7 +332,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a deps = [ "deps/uv", "$node_simdutf_path", -@@ -292,26 +298,75 @@ template("node_gn_build") { +@@ -298,26 +310,75 @@ template("node_gn_build") { "src/embedded_data.cc", "src/embedded_data.h", ] @@ -457,7 +418,7 @@ index 9e496d99d7141bf42ef7374a3c676c7b333eeeab..a2f3a769ceaa08db6d7438223884dc5a outputs = [ "$target_gen_dir/node_javascript.cc" ] # Get the path to node_js2c executable of the host toolchain. -@@ -325,11 +380,11 @@ template("node_gn_build") { +@@ -331,11 +392,11 @@ template("node_gn_build") { get_label_info(":node_js2c($host_toolchain)", "name") + host_executable_suffix diff --git a/patches/node/build_allow_unbundling_of_node_js_dependencies.patch b/patches/node/build_allow_unbundling_of_node_js_dependencies.patch index 952cc525820f..a38d9cc5f007 100644 --- a/patches/node/build_allow_unbundling_of_node_js_dependencies.patch +++ b/patches/node/build_allow_unbundling_of_node_js_dependencies.patch @@ -14,10 +14,10 @@ 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 diff --git a/unofficial.gni b/unofficial.gni -index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d26c4db206 100644 +index 672e97436d9220e8d5046b0c92025f50ae50a3d8..a8ce18acfe333350f91b3e5f235db5f756b2e34a 100644 --- a/unofficial.gni +++ b/unofficial.gni -@@ -153,7 +153,6 @@ template("node_gn_build") { +@@ -155,7 +155,6 @@ template("node_gn_build") { ":run_node_js2c", "deps/cares", "deps/histogram", @@ -25,7 +25,7 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2 "deps/nbytes", "deps/nghttp2", "deps/postject", -@@ -184,7 +183,17 @@ template("node_gn_build") { +@@ -191,7 +190,17 @@ template("node_gn_build") { configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs += [ "//build/config/gcc:symbol_visibility_default" ] } @@ -44,7 +44,7 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2 if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } -@@ -212,6 +221,19 @@ template("node_gn_build") { +@@ -219,6 +228,19 @@ template("node_gn_build") { sources += node_inspector.node_inspector_sources + node_inspector.node_inspector_generated_sources } @@ -63,4 +63,4 @@ index 08603eaef2da51fd92f9bf977647b56409eff48c..cd0eae52ca9bf244e43643a2034fa9d2 + } } - executable(target_name) { + config("zstd_include_config") { diff --git a/patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch b/patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch index 9f5b3c70a4ef..68cbb15ef5ea 100644 --- a/patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch +++ b/patches/node/build_change_crdtp_protocoltypetraits_signatures_to_avoid_conflict.patch @@ -14,7 +14,7 @@ error: duplicate symbol: crdtp::ProtocolTypeTraits -Date: Mon, 3 Feb 2025 21:44:36 +0900 -Subject: build: remove explicit linker call to libm on macOS - -/usr/lib/libm.tbd is available via libSystem.*.dylib and -reexports sanitizer symbols. When building for asan -this becomes an issue as the linker will resolve the symbols -from the system library rather from libclang_rt.* - -For V8 that rely on specific version of these symbols -that get bundled as part of clang, for ex: -https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97 -accepting nullptr for shadow_offset in `asan_get_shadow_mapping`, -linking to system version that doesn't support this will lead to -a crash. - -Clang driver eventually links with `-lSystem` -https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631, -this is done after linking the sanitizer libraries which -ensures right order of resolution for the symbols. - -PR-URL: https://github.com/nodejs/node/pull/56901 -Reviewed-By: Joyee Cheung -Reviewed-By: Chengzhong Wu -Reviewed-By: Luigi Pinca -Reviewed-By: Shelley Vohr - -diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni -index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644 ---- a/deps/brotli/unofficial.gni -+++ b/deps/brotli/unofficial.gni -@@ -25,7 +25,7 @@ template("brotli_gn_build") { - } else if (target_os == "freebsd") { - defines = [ "OS_FREEBSD" ] - } -- if (!is_win) { -+ if (is_linux) { - libs = [ "m" ] - } - if (is_clang || !is_win) { -diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni -index 348d2f0703e47ca7c5326a4b4c1d6ae31157eeb5..0944d6ddd241b113970ab6aa5804f9534fde882a 100644 ---- a/deps/uv/unofficial.gni -+++ b/deps/uv/unofficial.gni -@@ -87,11 +87,11 @@ template("uv_gn_build") { - ] - } - if (is_posix) { -- libs = [ "m" ] - ldflags = [ "-pthread" ] - } - if (is_linux) { -- libs += [ -+ libs = [ -+ "m", - "dl", - "rt", - ] diff --git a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch index be9e0aeffa01..7c7f11672aeb 100644 --- a/patches/node/build_restore_clang_as_default_compiler_on_macos.patch +++ b/patches/node/build_restore_clang_as_default_compiler_on_macos.patch @@ -11,10 +11,10 @@ node-gyp will use the result of `process.config` that reflects the environment in which the binary got built. diff --git a/common.gypi b/common.gypi -index a7a0ffde7209de51ffcbf0db0ed7efcf09ad606d..20fd68eeb878b51f361d72070d87338db3d9a8d4 100644 +index 99b147482b636706b1372b89298f35b60ca2bb31..5024e5fb0aee210f4986572638a523db6d26b4cc 100644 --- a/common.gypi +++ b/common.gypi -@@ -125,6 +125,7 @@ +@@ -127,6 +127,7 @@ 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', }], ['OS=="mac"', { diff --git a/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch b/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch index b07d10c2715e..a51aa2f27749 100644 --- a/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch +++ b/patches/node/chore_disable_deprecation_ftbfs_in_simdjson_header.patch @@ -11,10 +11,10 @@ Without this patch, building with simdjson fails with This patch can be removed once this is fixed upstream in simdjson. diff --git a/deps/simdjson/simdjson.h b/deps/simdjson/simdjson.h -index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be07265bfeeab 100644 +index c1535ee81300b9cb93eb9ee6e769246793f936c3..3350287401e181e1d4ee432b8bd16081d0d7a73e 100644 --- a/deps/simdjson/simdjson.h +++ b/deps/simdjson/simdjson.h -@@ -3654,12 +3654,17 @@ inline std::ostream& operator<<(std::ostream& out, simdjson_result padded_string::load(std::string_view filen +@@ -4242,6 +4247,9 @@ inline simdjson_result padded_string::load(std::string_view filen } // namespace simdjson +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-literal-operator" + - inline simdjson::padded_string operator "" _padded(const char *str, size_t len) { + inline simdjson::padded_string operator ""_padded(const char *str, size_t len) { return simdjson::padded_string(str, len); } -@@ -4045,6 +4053,8 @@ inline simdjson::padded_string operator "" _padded(const char8_t *str, size_t le +@@ -4250,6 +4258,8 @@ inline simdjson::padded_string operator ""_padded(const char8_t *str, size_t len return simdjson::padded_string(reinterpret_cast(str), len); } #endif @@ -51,10 +51,3 @@ index f21cd9381eef59ec43502c796fcaddb1b96525f5..e691fd24aa24d225f8c00fa5638be072 #endif // SIMDJSON_PADDED_STRING_INL_H /* end file simdjson/padded_string-inl.h */ /* skipped duplicate #include "simdjson/padded_string_view.h" */ -@@ -118292,4 +118302,4 @@ namespace simdjson { - /* end file simdjson/ondemand.h */ - - #endif // SIMDJSON_H --/* end file simdjson.h */ -+/* end file simdjson.h */ -\ No newline at end of file diff --git a/patches/node/chore_expose_importmoduledynamically_and.patch b/patches/node/chore_expose_importmoduledynamically_and.patch index 2596e1482f10..5e9f79e6ff54 100644 --- a/patches/node/chore_expose_importmoduledynamically_and.patch +++ b/patches/node/chore_expose_importmoduledynamically_and.patch @@ -11,7 +11,7 @@ its own blended handler between Node and Blink. Not upstreamable. diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js -index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be57620717e 100644 +index fd17ce8695c55f8f38ed19d59960acc1a7692bc8..96754db3277b3a0445b69275368602166c6d5423 100644 --- a/lib/internal/modules/esm/utils.js +++ b/lib/internal/modules/esm/utils.js @@ -30,7 +30,7 @@ const { @@ -23,7 +23,7 @@ index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be5 const { loadPreloadModules, initializeFrozenIntrinsics, -@@ -274,12 +274,13 @@ let _forceDefaultLoader = false; +@@ -280,12 +280,13 @@ let _forceDefaultLoader = false; * @param {boolean} [forceDefaultLoader=false] - A boolean indicating disabling custom loaders. */ function initializeESM(forceDefaultLoader = false) { @@ -40,10 +40,10 @@ index 99061e62976e7cb24be81e8632b0e21d1e9adf9a..bbc9311c059e8ab0328c5f92b21a6be5 /** diff --git a/src/module_wrap.cc b/src/module_wrap.cc -index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba430915fd79d8 100644 +index 912acc8da815405531d8b527383f19c3731be100..8d48f4693c3b5f0d1d94d3edadc48c4f36d1bf97 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc -@@ -832,7 +832,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( +@@ -858,7 +858,7 @@ MaybeLocal ModuleWrap::ResolveModuleCallback( return module->module_.Get(isolate); } @@ -52,7 +52,7 @@ index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba4309 Local context, Local host_defined_options, Local resource_name, -@@ -897,12 +897,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( +@@ -923,12 +923,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( Realm* realm = Realm::GetCurrent(args); HandleScope handle_scope(isolate); @@ -68,7 +68,7 @@ index 649ec428e2dd6fbf0082b3f1ba9fdfbfab892a94..168912fe6ede3b71ab3029c292ba4309 } void ModuleWrap::HostInitializeImportMetaObjectCallback( -@@ -944,13 +945,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( +@@ -970,13 +971,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback( Realm* realm = Realm::GetCurrent(args); Isolate* isolate = realm->isolate(); diff --git a/patches/node/cli_move_--trace-atomics-wait_to_eol.patch b/patches/node/cli_move_--trace-atomics-wait_to_eol.patch index a9a2aa7f1d2c..70ae224eebb1 100644 --- a/patches/node/cli_move_--trace-atomics-wait_to_eol.patch +++ b/patches/node/cli_move_--trace-atomics-wait_to_eol.patch @@ -15,747 +15,17 @@ Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yagiz Nizipli diff --git a/doc/api/cli.md b/doc/api/cli.md -index 431a6aa7a2cf4d537cb719f15c2749254e0433b3..1d1672a01c4fae6b339cb144d0d6e35b49209a14 100644 +index 114b7bbf6b1e105fc1696ed8a064065db73ff519..ad863e52761332c3249a86af0e3d239cd0f73b03 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -32,11 +32,11 @@ is passed. If no corresponding file is found, an error is thrown. - If a file is found, its path will be passed to the - [ES module loader][Modules loaders] under any of the following conditions: - --* The program was started with a command-line flag that forces the entry -+- The program was started with a command-line flag that forces the entry - point to be loaded with ECMAScript module loader, such as `--import` or - [`--experimental-default-type=module`][]. --* The file has an `.mjs` extension. --* The file does not have a `.cjs` extension, and the nearest parent -+- The file has an `.mjs` extension. -+- The file does not have a `.cjs` extension, and the nearest parent - `package.json` file contains a top-level [`"type"`][] field with a value of - `"module"`. - -@@ -164,7 +164,10 @@ Example: - ```js - const childProcess = require('node:child_process'); - // Attempt to bypass the permission --childProcess.spawn('node', ['-e', 'require("fs").writeFileSync("/new-file", "example")']); -+childProcess.spawn('node', [ -+ '-e', -+ 'require("fs").writeFileSync("/new-file", "example")', -+]); - ``` - - ```console -@@ -206,8 +209,8 @@ the [Permission Model][]. - - The valid arguments for the `--allow-fs-read` flag are: - --* `*` - To allow all `FileSystemRead` operations. --* Multiple paths can be allowed using multiple `--allow-fs-read` flags. -+- `*` - To allow all `FileSystemRead` operations. -+- Multiple paths can be allowed using multiple `--allow-fs-read` flags. - Example `--allow-fs-read=/folder1/ --allow-fs-read=/folder1/` - - Examples can be found in the [File System Permissions][] documentation. -@@ -251,8 +254,8 @@ the [Permission Model][]. - - The valid arguments for the `--allow-fs-write` flag are: - --* `*` - To allow all `FileSystemWrite` operations. --* Multiple paths can be allowed using multiple `--allow-fs-write` flags. -+- `*` - To allow all `FileSystemWrite` operations. -+- Multiple paths can be allowed using multiple `--allow-fs-write` flags. - Example `--allow-fs-write=/folder1/ --allow-fs-write=/folder1/` - - Paths delimited by comma (`,`) are no longer allowed. -@@ -399,10 +402,10 @@ creation behavior. - - The following options are currently supported: - --* `builder` {string} Required. Provides the name to the script that is executed -+- `builder` {string} Required. Provides the name to the script that is executed - before building the snapshot, as if [`--build-snapshot`][] had been passed - with `builder` as the main script name. --* `withoutCodeCache` {boolean} Optional. Including the code cache reduces the -+- `withoutCodeCache` {boolean} Optional. Including the code cache reduces the - time spent on compiling functions included in the snapshot at the expense - of a bigger snapshot size and potentially breaking portability of the - snapshot. -@@ -550,9 +553,9 @@ Defaults to current working directory. - - Affects the default output directory of: - --* [`--cpu-prof-dir`][] --* [`--heap-prof-dir`][] --* [`--redirect-warnings`][] -+- [`--cpu-prof-dir`][] -+- [`--heap-prof-dir`][] -+- [`--redirect-warnings`][] - - ### `--disable-proto=mode` - -@@ -697,9 +700,9 @@ changes: - Set the default value of `order` in [`dns.lookup()`][] and - [`dnsPromises.lookup()`][]. The value could be: - --* `ipv4first`: sets default `order` to `ipv4first`. --* `ipv6first`: sets default `order` to `ipv6first`. --* `verbatim`: sets default `order` to `verbatim`. -+- `ipv4first`: sets default `order` to `ipv4first`. -+- `ipv6first`: sets default `order` to `ipv6first`. -+- `verbatim`: sets default `order` to `verbatim`. - - The default is `verbatim` and [`dns.setDefaultResultOrder()`][] have higher - priority than `--dns-result-order`. -@@ -890,7 +893,7 @@ added: v22.7.0 - > Stability: 1 - Experimental - - Enables the use of [`AsyncLocalStorage`][] backed by `AsyncContextFrame` rather --than the default implementation which relies on async\_hooks. This new model is -+than the default implementation which relies on async_hooks. This new model is - implemented very differently and so could have differences in how context data - flows within the application. As such, it is presently recommended to be sure - your application behaviour is unaffected by this change before using it in -@@ -909,12 +912,12 @@ added: - - Define which module system, `module` or `commonjs`, to use for the following: - --* String input provided via `--eval` or STDIN, if `--input-type` is unspecified. -+- String input provided via `--eval` or STDIN, if `--input-type` is unspecified. - --* Files ending in `.js` or with no extension, if there is no `package.json` file -+- Files ending in `.js` or with no extension, if there is no `package.json` file - present in the same folder or any parent folder. - --* Files ending in `.js` or with no extension, if the nearest parent -+- Files ending in `.js` or with no extension, if the nearest parent - `package.json` field lacks a `"type"` field; unless the `package.json` folder - or any parent folder is inside a `node_modules` folder. - -@@ -1450,15 +1453,15 @@ interoperability with non-conformant HTTP implementations. - - When enabled, the parser will accept the following: - --* Invalid HTTP headers values. --* Invalid HTTP versions. --* Allow message containing both `Transfer-Encoding` -+- Invalid HTTP headers values. -+- Invalid HTTP versions. -+- Allow message containing both `Transfer-Encoding` - and `Content-Length` headers. --* Allow extra data after message when `Connection: close` is present. --* Allow extra transfer encodings after `chunked` has been provided. --* Allow `\n` to be used as token separator instead of `\r\n`. --* Allow `\r\n` not to be provided after a chunk. --* Allow spaces to be present after a chunk size and before `\r\n`. -+- Allow extra data after message when `Connection: close` is present. -+- Allow extra transfer encodings after `chunked` has been provided. -+- Allow `\n` to be used as token separator instead of `\r\n`. -+- Allow `\r\n` not to be provided after a chunk. -+- Allow spaces to be present after a chunk size and before `\r\n`. - - All the above will expose your application to request smuggling - or poisoning attack. Avoid using this option. -@@ -1536,8 +1539,8 @@ a [remote code execution][] attack. - - If specifying a host, make sure that either: - --* The host is not accessible from public networks. --* A firewall disallows unwanted connections on the port. -+- The host is not accessible from public networks. -+- A firewall disallows unwanted connections on the port. - - **More specifically, `--inspect=0.0.0.0` is insecure if the port (`9229` by - default) is not firewall-protected.** -@@ -1799,7 +1802,7 @@ added: - --> - - Enable OpenSSL 3.0 legacy provider. For more information please see --[OSSL\_PROVIDER-legacy][OSSL_PROVIDER-legacy]. -+[OSSL_PROVIDER-legacy][OSSL_PROVIDER-legacy]. - - ### `--openssl-shared-config` - -@@ -1849,12 +1852,12 @@ changes: - Enable the Permission Model for current process. When enabled, the - following permissions are restricted: - --* File System - manageable through -+- File System - manageable through - [`--allow-fs-read`][], [`--allow-fs-write`][] flags --* Child Process - manageable through [`--allow-child-process`][] flag --* Worker Threads - manageable through [`--allow-worker`][] flag --* WASI - manageable through [`--allow-wasi`][] flag --* Addons - manageable through [`--allow-addons`][] flag -+- Child Process - manageable through [`--allow-child-process`][] flag -+- Worker Threads - manageable through [`--allow-worker`][] flag -+- WASI - manageable through [`--allow-wasi`][] flag -+- Addons - manageable through [`--allow-addons`][] flag - - ### `--preserve-symlinks` - -@@ -2194,16 +2197,16 @@ cases. - Some features of other `run` implementations that are intentionally excluded - are: - --* Running `pre` or `post` scripts in addition to the specified script. --* Defining package manager-specific environment variables. -+- Running `pre` or `post` scripts in addition to the specified script. -+- Defining package manager-specific environment variables. - - #### Environment variables - - The following environment variables are set when running a script with `--run`: - --* `NODE_RUN_SCRIPT_NAME`: The name of the script being run. For example, if -+- `NODE_RUN_SCRIPT_NAME`: The name of the script being run. For example, if - `--run` is used to run `test`, the value of this variable will be `test`. --* `NODE_RUN_PACKAGE_JSON_PATH`: The path to the `package.json` that is being -+- `NODE_RUN_PACKAGE_JSON_PATH`: The path to the `package.json` that is being - processed. - - ### `--secure-heap-min=n` -@@ -2601,39 +2604,6 @@ added: v12.0.0 - Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support - for TLSv1.2, which is not as secure as TLSv1.3. - --### `--trace-atomics-wait` -- -- -- --> Stability: 0 - Deprecated -- --Print short summaries of calls to [`Atomics.wait()`][] to stderr. --The output could look like this: -- --```text --(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) started --(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) did not wait because the values mismatched --(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) started --(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) timed out --(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) started --(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) started --(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread --(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread --``` -- --The fields here correspond to: -- --* The thread id as given by [`worker_threads.threadId`][] --* The base address of the `SharedArrayBuffer` in question, as well as the -- byte offset corresponding to the index passed to `Atomics.wait()` --* The expected value that was passed to `Atomics.wait()` --* The timeout passed to `Atomics.wait` -- - ### `--trace-deprecation` - - - --* `--allow-addons` --* `--allow-child-process` --* `--allow-fs-read` --* `--allow-fs-write` --* `--allow-wasi` --* `--allow-worker` --* `--conditions`, `-C` --* `--diagnostic-dir` --* `--disable-proto` --* `--disable-sigusr1` --* `--disable-warning` --* `--disable-wasm-trap-handler` --* `--dns-result-order` --* `--enable-fips` --* `--enable-network-family-autoselection` --* `--enable-source-maps` --* `--entry-url` --* `--experimental-abortcontroller` --* `--experimental-async-context-frame` --* `--experimental-default-type` --* `--experimental-detect-module` --* `--experimental-eventsource` --* `--experimental-import-meta-resolve` --* `--experimental-json-modules` --* `--experimental-loader` --* `--experimental-modules` --* `--experimental-permission` --* `--experimental-print-required-tla` --* `--experimental-require-module` --* `--experimental-shadow-realm` --* `--experimental-specifier-resolution` --* `--experimental-strip-types` --* `--experimental-top-level-await` --* `--experimental-transform-types` --* `--experimental-vm-modules` --* `--experimental-wasi-unstable-preview1` --* `--experimental-wasm-modules` --* `--experimental-webstorage` --* `--force-context-aware` --* `--force-fips` --* `--force-node-api-uncaught-exceptions-policy` --* `--frozen-intrinsics` --* `--heap-prof-dir` --* `--heap-prof-interval` --* `--heap-prof-name` --* `--heap-prof` --* `--heapsnapshot-near-heap-limit` --* `--heapsnapshot-signal` --* `--http-parser` --* `--icu-data-dir` --* `--import` --* `--input-type` --* `--insecure-http-parser` --* `--inspect-brk` --* `--inspect-port`, `--debug-port` --* `--inspect-publish-uid` --* `--inspect-wait` --* `--inspect` --* `--localstorage-file` --* `--max-http-header-size` --* `--napi-modules` --* `--network-family-autoselection-attempt-timeout` --* `--no-addons` --* `--no-deprecation` --* `--no-experimental-fetch` --* `--no-experimental-global-customevent` --* `--no-experimental-global-navigator` --* `--no-experimental-global-webcrypto` --* `--no-experimental-repl-await` --* `--no-experimental-sqlite` --* `--no-experimental-websocket` --* `--no-extra-info-on-fatal-exception` --* `--no-force-async-hooks-checks` --* `--no-global-search-paths` --* `--no-network-family-autoselection` --* `--no-warnings` --* `--node-memory-debug` --* `--openssl-config` --* `--openssl-legacy-provider` --* `--openssl-shared-config` --* `--pending-deprecation` --* `--permission` --* `--preserve-symlinks-main` --* `--preserve-symlinks` --* `--prof-process` --* `--redirect-warnings` --* `--report-compact` --* `--report-dir`, `--report-directory` --* `--report-exclude-env` --* `--report-exclude-network` --* `--report-filename` --* `--report-on-fatalerror` --* `--report-on-signal` --* `--report-signal` --* `--report-uncaught-exception` --* `--require`, `-r` --* `--secure-heap-min` --* `--secure-heap` --* `--snapshot-blob` --* `--test-coverage-branches` --* `--test-coverage-exclude` --* `--test-coverage-functions` --* `--test-coverage-include` --* `--test-coverage-lines` --* `--test-name-pattern` --* `--test-only` --* `--test-reporter-destination` --* `--test-reporter` --* `--test-shard` --* `--test-skip-pattern` --* `--throw-deprecation` --* `--title` --* `--tls-cipher-list` --* `--tls-keylog` --* `--tls-max-v1.2` --* `--tls-max-v1.3` --* `--tls-min-v1.0` --* `--tls-min-v1.1` --* `--tls-min-v1.2` --* `--tls-min-v1.3` +@@ -3313,7 +3313,6 @@ one is included in the list below. + * `--tls-min-v1.1` + * `--tls-min-v1.2` + * `--tls-min-v1.3` -* `--trace-atomics-wait` --* `--trace-deprecation` --* `--trace-env-js-stack` --* `--trace-env-native-stack` --* `--trace-env` --* `--trace-event-categories` --* `--trace-event-file-pattern` --* `--trace-events-enabled` --* `--trace-exit` --* `--trace-require-module` --* `--trace-sigint` --* `--trace-sync-io` --* `--trace-tls` --* `--trace-uncaught` --* `--trace-warnings` --* `--track-heap-objects` --* `--unhandled-rejections` --* `--use-bundled-ca` --* `--use-largepages` --* `--use-openssl-ca` --* `--v8-pool-size` --* `--watch-path` --* `--watch-preserve-output` --* `--watch` --* `--zero-fill-buffers` -+- `--allow-addons` -+- `--allow-child-process` -+- `--allow-fs-read` -+- `--allow-fs-write` -+- `--allow-wasi` -+- `--allow-worker` -+- `--conditions`, `-C` -+- `--diagnostic-dir` -+- `--disable-proto` -+- `--disable-sigusr1` -+- `--disable-warning` -+- `--disable-wasm-trap-handler` -+- `--dns-result-order` -+- `--enable-fips` -+- `--enable-network-family-autoselection` -+- `--enable-source-maps` -+- `--entry-url` -+- `--experimental-abortcontroller` -+- `--experimental-async-context-frame` -+- `--experimental-default-type` -+- `--experimental-detect-module` -+- `--experimental-eventsource` -+- `--experimental-import-meta-resolve` -+- `--experimental-json-modules` -+- `--experimental-loader` -+- `--experimental-modules` -+- `--experimental-permission` -+- `--experimental-print-required-tla` -+- `--experimental-require-module` -+- `--experimental-shadow-realm` -+- `--experimental-specifier-resolution` -+- `--experimental-strip-types` -+- `--experimental-top-level-await` -+- `--experimental-transform-types` -+- `--experimental-vm-modules` -+- `--experimental-wasi-unstable-preview1` -+- `--experimental-wasm-modules` -+- `--experimental-webstorage` -+- `--force-context-aware` -+- `--force-fips` -+- `--force-node-api-uncaught-exceptions-policy` -+- `--frozen-intrinsics` -+- `--heap-prof-dir` -+- `--heap-prof-interval` -+- `--heap-prof-name` -+- `--heap-prof` -+- `--heapsnapshot-near-heap-limit` -+- `--heapsnapshot-signal` -+- `--http-parser` -+- `--icu-data-dir` -+- `--import` -+- `--input-type` -+- `--insecure-http-parser` -+- `--inspect-brk` -+- `--inspect-port`, `--debug-port` -+- `--inspect-publish-uid` -+- `--inspect-wait` -+- `--inspect` -+- `--localstorage-file` -+- `--max-http-header-size` -+- `--napi-modules` -+- `--network-family-autoselection-attempt-timeout` -+- `--no-addons` -+- `--no-deprecation` -+- `--no-experimental-fetch` -+- `--no-experimental-global-customevent` -+- `--no-experimental-global-navigator` -+- `--no-experimental-global-webcrypto` -+- `--no-experimental-repl-await` -+- `--no-experimental-sqlite` -+- `--no-experimental-websocket` -+- `--no-extra-info-on-fatal-exception` -+- `--no-force-async-hooks-checks` -+- `--no-global-search-paths` -+- `--no-network-family-autoselection` -+- `--no-warnings` -+- `--node-memory-debug` -+- `--openssl-config` -+- `--openssl-legacy-provider` -+- `--openssl-shared-config` -+- `--pending-deprecation` -+- `--permission` -+- `--preserve-symlinks-main` -+- `--preserve-symlinks` -+- `--prof-process` -+- `--redirect-warnings` -+- `--report-compact` -+- `--report-dir`, `--report-directory` -+- `--report-exclude-env` -+- `--report-exclude-network` -+- `--report-filename` -+- `--report-on-fatalerror` -+- `--report-on-signal` -+- `--report-signal` -+- `--report-uncaught-exception` -+- `--require`, `-r` -+- `--secure-heap-min` -+- `--secure-heap` -+- `--snapshot-blob` -+- `--test-coverage-branches` -+- `--test-coverage-exclude` -+- `--test-coverage-functions` -+- `--test-coverage-include` -+- `--test-coverage-lines` -+- `--test-name-pattern` -+- `--test-only` -+- `--test-reporter-destination` -+- `--test-reporter` -+- `--test-shard` -+- `--test-skip-pattern` -+- `--throw-deprecation` -+- `--title` -+- `--tls-cipher-list` -+- `--tls-keylog` -+- `--tls-max-v1.2` -+- `--tls-max-v1.3` -+- `--tls-min-v1.0` -+- `--tls-min-v1.1` -+- `--tls-min-v1.2` -+- `--tls-min-v1.3` -+- `--trace-deprecation` -+- `--trace-env-js-stack` -+- `--trace-env-native-stack` -+- `--trace-env` -+- `--trace-event-categories` -+- `--trace-event-file-pattern` -+- `--trace-events-enabled` -+- `--trace-exit` -+- `--trace-require-module` -+- `--trace-sigint` -+- `--trace-sync-io` -+- `--trace-tls` -+- `--trace-uncaught` -+- `--trace-warnings` -+- `--track-heap-objects` -+- `--unhandled-rejections` -+- `--use-bundled-ca` -+- `--use-largepages` -+- `--use-openssl-ca` -+- `--v8-pool-size` -+- `--watch-path` -+- `--watch-preserve-output` -+- `--watch` -+- `--zero-fill-buffers` - - - -@@ -3266,19 +3235,19 @@ V8 options that are allowed are: - - - --* `--abort-on-uncaught-exception` --* `--disallow-code-generation-from-strings` --* `--enable-etw-stack-walking` --* `--expose-gc` --* `--interpreted-frames-native-stack` --* `--jitless` --* `--max-old-space-size` --* `--max-semi-space-size` --* `--perf-basic-prof-only-functions` --* `--perf-basic-prof` --* `--perf-prof-unwinding-info` --* `--perf-prof` --* `--stack-trace-limit` -+- `--abort-on-uncaught-exception` -+- `--disallow-code-generation-from-strings` -+- `--enable-etw-stack-walking` -+- `--expose-gc` -+- `--interpreted-frames-native-stack` -+- `--jitless` -+- `--max-old-space-size` -+- `--max-semi-space-size` -+- `--perf-basic-prof-only-functions` -+- `--perf-basic-prof` -+- `--perf-prof-unwinding-info` -+- `--perf-prof` -+- `--stack-trace-limit` - - - -@@ -3446,23 +3415,12 @@ and the line lengths of the source file (in the key `lineLengths`). - "url": "./path-to-map.json", - "data": { - "version": 3, -- "sources": [ -- "file:///absolute/path/to/original.js" -- ], -- "names": [ -- "Foo", -- "console", -- "info" -- ], -+ "sources": ["file:///absolute/path/to/original.js"], -+ "names": ["Foo", "console", "info"], - "mappings": "MAAMA,IACJC,YAAaC", - "sourceRoot": "./" - }, -- "lineLengths": [ -- 13, -- 62, -- 38, -- 27 -- ] -+ "lineLengths": [13, 62, 38, 27] - } - } - } -@@ -3470,7 +3428,7 @@ and the line lengths of the source file (in the key `lineLengths`). - - ### `NO_COLOR=` - --[`NO_COLOR`][] is an alias for `NODE_DISABLE_COLORS`. The value of the -+[`NO_COLOR`][] is an alias for `NODE_DISABLE_COLORS`. The value of the - environment variable is arbitrary. - - ### `OPENSSL_CONF=file` -@@ -3552,12 +3510,12 @@ Asynchronous system APIs are used by Node.js whenever possible, but where they - do not exist, libuv's threadpool is used to create asynchronous node APIs based - on synchronous system APIs. Node.js APIs that use the threadpool are: - --* all `fs` APIs, other than the file watcher APIs and those that are explicitly -+- all `fs` APIs, other than the file watcher APIs and those that are explicitly - synchronous --* asynchronous crypto APIs such as `crypto.pbkdf2()`, `crypto.scrypt()`, -+- asynchronous crypto APIs such as `crypto.pbkdf2()`, `crypto.scrypt()`, - `crypto.randomBytes()`, `crypto.randomFill()`, `crypto.generateKeyPair()` --* `dns.lookup()` --* all `zlib` APIs, other than those that are explicitly synchronous -+- `dns.lookup()` -+- all `zlib` APIs, other than those that are explicitly synchronous - - Because libuv's threadpool has a fixed size, it means that if for whatever - reason any of these APIs takes a long time, other (seemingly unrelated) APIs -@@ -3723,7 +3681,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12 - [`--redirect-warnings`]: #--redirect-warningsfile - [`--require`]: #-r---require-module - [`AsyncLocalStorage`]: async_context.md#class-asynclocalstorage --[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait - [`Buffer`]: buffer.md#class-buffer - [`CRYPTO_secure_malloc_init`]: https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html - [`ERR_INVALID_TYPESCRIPT_SYNTAX`]: errors.md#err_invalid_typescript_syntax -@@ -3746,7 +3703,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12 - [`tls.DEFAULT_MIN_VERSION`]: tls.md#tlsdefault_min_version - [`unhandledRejection`]: process.md#event-unhandledrejection - [`v8.startupSnapshot` API]: v8.md#startup-snapshot-api --[`worker_threads.threadId`]: worker_threads.md#workerthreadid - [collecting code coverage from tests]: test.md#collecting-code-coverage - [conditional exports]: packages.md#conditional-exports - [context-aware]: addons.md#context-aware-addons -diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md -index 0df7dce60058d518c9607094344461b60e540e60..f5f8ac77c848edf62b0a82f0644f61077a02aedd 100644 ---- a/doc/api/deprecations.md -+++ b/doc/api/deprecations.md -@@ -3313,6 +3313,9 @@ Values other than `undefined`, `null`, integer numbers, and integer strings - - - --Type: Runtime -+Type: End-of-Life - --The [`--trace-atomics-wait`][] flag is deprecated because -+The `--trace-atomics-wait` flag has been removed because - it uses the V8 hook `SetAtomicsWaitCallback`, - that will be removed in a future V8 release. - -@@ -3737,7 +3740,6 @@ deprecated, as their values are guaranteed to be identical to that of `process.f - [`--force-node-api-uncaught-exceptions-policy`]: cli.md#--force-node-api-uncaught-exceptions-policy - [`--pending-deprecation`]: cli.md#--pending-deprecation - [`--throw-deprecation`]: cli.md#--throw-deprecation --[`--trace-atomics-wait`]: cli.md#--trace-atomics-wait - [`--unhandled-rejections`]: cli.md#--unhandled-rejectionsmode - [`Buffer.allocUnsafeSlow(size)`]: buffer.md#static-method-bufferallocunsafeslowsize - [`Buffer.from(array)`]: buffer.md#static-method-bufferfromarray + * `--trace-deprecation` + * `--trace-env-js-stack` + * `--trace-env-native-stack` diff --git a/doc/node.1 b/doc/node.1 index 9f534746ef9d9c1c1ee2edd6c195573a2e228600..e01fc511a1034518c0fb9bc5fa925524aecad927 100644 --- a/doc/node.1 @@ -773,7 +43,7 @@ index 9f534746ef9d9c1c1ee2edd6c195573a2e228600..e01fc511a1034518c0fb9bc5fa925524 Print stack traces for deprecations. . diff --git a/src/node.cc b/src/node.cc -index 0ed78ab6b52906e980eebf1f625a1c7cbfc8097b..2ff08a9cb6124316049a91bda70cf6985045286a 100644 +index 2f58a6fa69069dabb99b5ddb8011991b07fa5f02..9f6fa646ba6673f67f5f625e157ed850633a26da 100644 --- a/src/node.cc +++ b/src/node.cc @@ -226,44 +226,6 @@ void Environment::WaitForInspectorFrontendByOptions() { @@ -840,10 +110,10 @@ index 0ed78ab6b52906e980eebf1f625a1c7cbfc8097b..2ff08a9cb6124316049a91bda70cf698 isolate_->SetPromiseHook(TracePromises); } diff --git a/src/node_options.cc b/src/node_options.cc -index 866f2a39a5e51a8bf434ccd54d76c685bcdd1502..2bedaa88582c369a4a420ff20a5204af96feb52e 100644 +index 54b253aa54f5cdebdb04315f9c6c2506977555c0..acf390bd456c7ddfa6987e440fb45940aec6b1ff 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -758,10 +758,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { +@@ -762,10 +762,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { "throw an exception on deprecations", &EnvironmentOptions::throw_deprecation, kAllowedInEnvvar); @@ -855,7 +125,7 @@ index 866f2a39a5e51a8bf434ccd54d76c685bcdd1502..2bedaa88582c369a4a420ff20a5204af "show stack traces on deprecations", &EnvironmentOptions::trace_deprecation, diff --git a/src/node_options.h b/src/node_options.h -index 41dd04f5e2b1cd54c32df70830389d44d7b39aa2..b10287d3eadc49b44e2e3fb8150a48be6866b0b4 100644 +index 065457acfde6ba4d04ed570cc72005cfd2798fd5..150f833bb21bd6d37f652f0785a4a98f3de5f67d 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -203,7 +203,6 @@ class EnvironmentOptions : public Options { diff --git a/patches/node/cli_remove_deprecated_v8_flag.patch b/patches/node/cli_remove_deprecated_v8_flag.patch index 5acad06fbdca..caff01e09ec1 100644 --- a/patches/node/cli_remove_deprecated_v8_flag.patch +++ b/patches/node/cli_remove_deprecated_v8_flag.patch @@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso Reviewed-By: Yagiz Nizipli diff --git a/doc/api/cli.md b/doc/api/cli.md -index 8105592764abca6036e8e029ca9b6a32402e7156..431a6aa7a2cf4d537cb719f15c2749254e0433b3 100644 +index 1b42c5a7f4715e56fa5bc39cd6f78a76473406f2..114b7bbf6b1e105fc1696ed8a064065db73ff519 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md -@@ -3270,7 +3270,6 @@ V8 options that are allowed are: +@@ -3350,7 +3350,6 @@ V8 options that are allowed are: * `--disallow-code-generation-from-strings` * `--enable-etw-stack-walking` * `--expose-gc` @@ -30,10 +30,10 @@ index 8105592764abca6036e8e029ca9b6a32402e7156..431a6aa7a2cf4d537cb719f15c274925 * `--jitless` * `--max-old-space-size` diff --git a/src/node_options.cc b/src/node_options.cc -index 620776c06d835eb1bfeed060751c570e8d435b29..866f2a39a5e51a8bf434ccd54d76c685bcdd1502 100644 +index b22fbb0a285f6f323779d6ebb2b027a3990b031e..54b253aa54f5cdebdb04315f9c6c2506977555c0 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -980,11 +980,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( +@@ -984,11 +984,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "disallow eval and friends", V8Option{}, kAllowedInEnvvar); @@ -46,10 +46,10 @@ index 620776c06d835eb1bfeed060751c570e8d435b29..866f2a39a5e51a8bf434ccd54d76c685 "disable runtime allocation of executable memory", V8Option{}, diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js -index b1d5c44ceeeebc674938d85736aace2a6ef570e2..9e89200e9f6dfd89340cd04afb76e271ffc82b54 100644 +index c5d74f40e7894980b45713c77cc36f836be73528..53bca572c3405c0357f868aae71fc2c82d973c04 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js -@@ -73,7 +73,6 @@ if (common.hasCrypto) { +@@ -76,7 +76,6 @@ if (common.hasCrypto) { expect('--abort_on-uncaught_exception', 'B\n'); expect('--disallow-code-generation-from-strings', 'B\n'); expect('--expose-gc', 'B\n'); diff --git a/patches/node/expose_get_builtin_module_function.patch b/patches/node/expose_get_builtin_module_function.patch index 39d3c031d4ef..bee428c16759 100644 --- a/patches/node/expose_get_builtin_module_function.patch +++ b/patches/node/expose_get_builtin_module_function.patch @@ -9,7 +9,7 @@ modules to sandboxed renderers. TODO(codebytere): remove and replace with a public facing API. diff --git a/src/node_binding.cc b/src/node_binding.cc -index c2ef9b36d5b2967c798c123b6cbbd099b15c2791..b5c0a93d83ab4d4f6792d0eb648e7198de874bcf 100644 +index 6c337232149ccb8bdb1188e72d59a052b1cb79c1..44ad4a480a33a2c39494a7d961318270a25620d8 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -653,6 +653,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { diff --git a/patches/node/feat_add_oom_error_callback_in_node_isolatesettings.patch b/patches/node/feat_add_oom_error_callback_in_node_isolatesettings.patch deleted file mode 100644 index 3eecb039f5d7..000000000000 --- a/patches/node/feat_add_oom_error_callback_in_node_isolatesettings.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Yang Liu -Date: Wed, 5 Mar 2025 17:22:39 +0800 -Subject: feat: add oom_error_callback in node::IsolateSettings - -Expose v8::OOMErrorCallback to allow setting OOM error handler outside Node.js - -As described in this issue https://github.com/electron/electron/issues/45894, -Electron fails to capture js heap oom because node::OOMErrorHandler just -terminates the process without raising an exception. - -To fix this issue, provide the interface oom_error_callback to enable a -custom oom error callback set from Electron. - -diff --git a/src/api/environment.cc b/src/api/environment.cc -index fc9b056d2f7e25109100fbde5f3ab0aebc8c619a..9b155213ce301df7e396a4a113992499fc7e9910 100644 ---- a/src/api/environment.cc -+++ b/src/api/environment.cc -@@ -241,7 +241,10 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) { - auto* fatal_error_cb = s.fatal_error_callback ? - s.fatal_error_callback : OnFatalError; - isolate->SetFatalErrorHandler(fatal_error_cb); -- isolate->SetOOMErrorHandler(OOMErrorHandler); -+ -+ auto* oom_error_cb = s.oom_error_callback ? -+ s.oom_error_callback : OOMErrorHandler; -+ isolate->SetOOMErrorHandler(oom_error_cb); - - if ((s.flags & SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK) == 0) { - auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ? -diff --git a/src/node.h b/src/node.h -index afb26ec5690ccd65a3c36f8b8a1b2de416b9d843..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644 ---- a/src/node.h -+++ b/src/node.h -@@ -489,6 +489,7 @@ struct IsolateSettings { - v8::Isolate::AbortOnUncaughtExceptionCallback - should_abort_on_uncaught_exception_callback = nullptr; - v8::FatalErrorCallback fatal_error_callback = nullptr; -+ v8::OOMErrorCallback oom_error_callback = nullptr; - v8::PrepareStackTraceCallback prepare_stack_trace_callback = nullptr; - - // Miscellaneous callbacks diff --git a/patches/node/fix_-wnonnull_warning.patch b/patches/node/fix_-wnonnull_warning.patch deleted file mode 100644 index a75eaf4b373d..000000000000 --- a/patches/node/fix_-wnonnull_warning.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charles Kerr -Date: Thu, 6 Mar 2025 19:31:29 -0600 -Subject: fix: -Wnonnull warning -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes this warning: - -> 2025-03-07T01:05:01.8637705Z ../../third_party/electron_node/src/debug_utils.cc(257,12): error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] -> 2025-03-07T01:05:01.8638267Z 257 | return nullptr; -> 2025-03-07T01:05:01.8638481Z | ^~~~~~~ -> 2025-03-07T01:05:01.8638700Z 1 error generated. - -Not sure why this warning was never triggered before; `git blame` -indicates this code hasn't changed in ages: - -> c40a8273ef2 (Michaël Zasso 2024-05-10 09:50:20 +0200 255) #endif // DEBUG -> 8e2d33f1562 (Anna Henningsen 2018-06-07 16:54:29 +0200 256) } -> 247b5130595 (Refael Ackermann 2018-10-22 15:07:00 -0400 257) return nullptr; -> 247b5130595 (Refael Ackermann 2018-10-22 15:07:00 -0400 258) } - -Presumably this is failing in this Chromium roll due to a -clang version bump. - -We should remove this patch after upstreaming it. - -Upstream PR: https://github.com/nodejs/node/pull/57354 - -diff --git a/src/debug_utils.cc b/src/debug_utils.cc -index c8b3b11ee34d7ac98163aa563fd7f6f1fb0a3b79..8a85e066fd9e6f3d6131eca89d52495f904cd5a6 100644 ---- a/src/debug_utils.cc -+++ b/src/debug_utils.cc -@@ -254,7 +254,7 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { - USE(GetLastError()); - #endif // DEBUG - } -- return nullptr; -+ return {}; - } - - SymbolInfo LookupSymbol(void* address) override { diff --git a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch index e1722fdc6426..45edf948a98d 100644 --- a/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch +++ b/patches/node/fix_add_default_values_for_variables_in_common_gypi.patch @@ -7,10 +7,10 @@ common.gypi is a file that's included in the node header bundle, despite the fact that we do not build node with gyp. diff --git a/common.gypi b/common.gypi -index 62f26bb07d27a02aedf18fdd1191b282f9340cac..5d74876ab28f8c10bb9543f7652478514414d8d2 100644 +index 372409f4b09cc3b3be9809f697816498e5c021fe..f2a45f0f0bbfce93e61d3696a18425af4d022a00 100644 --- a/common.gypi +++ b/common.gypi -@@ -88,6 +88,23 @@ +@@ -90,6 +90,23 @@ ##### end V8 defaults ##### diff --git a/patches/node/fix_allow_passing_fileexists_fn_to_legacymainresolve.patch b/patches/node/fix_allow_passing_fileexists_fn_to_legacymainresolve.patch index 79eff671572b..72074233f795 100644 --- a/patches/node/fix_allow_passing_fileexists_fn_to_legacymainresolve.patch +++ b/patches/node/fix_allow_passing_fileexists_fn_to_legacymainresolve.patch @@ -53,10 +53,10 @@ index 2879e5cf541fb4d226cfd7cc0fe367ca448fb926..03082f0ec4f91382933eec48e77331cd const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ? packageConfig.main || './' : ''; diff --git a/src/node_file.cc b/src/node_file.cc -index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5ae8bc1db 100644 +index a492b3aa113c4e1d50cc42721bd5eb58380a6264..c7915e2c8161a5d0fa05ccce368ce9c44345c05d 100644 --- a/src/node_file.cc +++ b/src/node_file.cc -@@ -3220,13 +3220,25 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo& args) { +@@ -3237,13 +3237,25 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo& args) { } BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile( @@ -83,7 +83,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5 uv_fs_t req; int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr); -@@ -3284,6 +3296,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { +@@ -3301,6 +3313,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { std::optional initial_file_path; std::string file_path; @@ -95,7 +95,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5 if (args.Length() >= 2 && args[1]->IsString()) { auto package_config_main = Utf8Value(isolate, args[1]).ToString(); -@@ -3304,7 +3321,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { +@@ -3321,7 +3338,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { BufferValue buff_file_path(isolate, local_file_path); ToNamespacedPath(env, &buff_file_path); @@ -104,7 +104,7 @@ index 1d22e19f16d5ad82466b0724971b2e4a685682f7..3d7e303741a73134e140152bed637fe5 case BindingData::FilePathIsFileReturnType::kIsFile: return args.GetReturnValue().Set(i); case BindingData::FilePathIsFileReturnType::kIsNotFile: -@@ -3341,7 +3358,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { +@@ -3358,7 +3375,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo& args) { BufferValue buff_file_path(isolate, local_file_path); ToNamespacedPath(env, &buff_file_path); diff --git a/patches/node/fix_assert_module_in_the_renderer_process.patch b/patches/node/fix_assert_module_in_the_renderer_process.patch index 86cfb0a302ff..e6ab076547af 100644 --- a/patches/node/fix_assert_module_in_the_renderer_process.patch +++ b/patches/node/fix_assert_module_in_the_renderer_process.patch @@ -44,10 +44,10 @@ index 59b5a16f1309a5e4055bccfdb7a529045ad30402..bfdaf6211466a01b64b7942f7b16c480 let filename = call.getFileName(); const line = call.getLineNumber() - 1; diff --git a/src/node_options.cc b/src/node_options.cc -index 3608ab2b4aeb09e985ca98e23f2dff23567ade71..620776c06d835eb1bfeed060751c570e8d435b29 100644 +index 23cb558a22b4462f5ce4f74833d25c7f712f8139..b22fbb0a285f6f323779d6ebb2b027a3990b031e 100644 --- a/src/node_options.cc +++ b/src/node_options.cc -@@ -1527,14 +1527,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { +@@ -1535,14 +1535,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo& args) { } Isolate* isolate = args.GetIsolate(); diff --git a/patches/node/fix_cppgc_initializing_twice.patch b/patches/node/fix_cppgc_initializing_twice.patch index f03ffed13d79..6ecf3b9675de 100644 --- a/patches/node/fix_cppgc_initializing_twice.patch +++ b/patches/node/fix_cppgc_initializing_twice.patch @@ -12,7 +12,7 @@ This can be removed/refactored once Node.js upgrades to a version of V8 containing the above CL. diff --git a/src/node.cc b/src/node.cc -index 2ff08a9cb6124316049a91bda70cf6985045286a..5de93329cbd40a2ca314d602b123092ed15741c5 100644 +index 9f6fa646ba6673f67f5f625e157ed850633a26da..63a462876c00588d22abdd6ed8ee41ecf6590d03 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1173,7 +1173,7 @@ InitializeOncePerProcessInternal(const std::vector& args, diff --git a/patches/node/fix_crypto_tests_to_run_with_bssl.patch b/patches/node/fix_crypto_tests_to_run_with_bssl.patch index 31ecfb8700b2..ce3b8f49c39a 100644 --- a/patches/node/fix_crypto_tests_to_run_with_bssl.patch +++ b/patches/node/fix_crypto_tests_to_run_with_bssl.patch @@ -11,7 +11,7 @@ before it's acceptable to upstream, as this patch comments out a couple of tests that upstream probably cares about. diff --git a/test/common/index.js b/test/common/index.js -index 92c7294e6f6298f511b5a289e1e0e3a4be68cc77..63a350c5ed912a785b042a238c064c98ed423af4 100644 +index 8f5af57a83dc6b426f1b11bd2e3a8c6c0f2d9a85..f6e00c9f3f3ac4b42662eed6c8d190586f92ab99 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -56,6 +56,8 @@ const hasCrypto = Boolean(process.versions.openssl) && @@ -23,7 +23,7 @@ index 92c7294e6f6298f511b5a289e1e0e3a4be68cc77..63a350c5ed912a785b042a238c064c98 function parseTestFlags(filename = process.argv[1]) { // The copyright notice is relatively big and the flags could come afterwards. const bytesToRead = 1500; -@@ -889,6 +891,7 @@ const common = { +@@ -901,6 +903,7 @@ const common = { mustNotMutateObjectDeep, mustSucceed, nodeProcessAborted, @@ -294,24 +294,6 @@ index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..a18aeb2bdffcc7a7e9ef12328b849994 }); // No-pad encrypted string should return the same: -diff --git a/test/parallel/test-crypto-prime.js b/test/parallel/test-crypto-prime.js -index 5ffdc1394282be046150e3759f82f8787f5604f7..e1c7a7b4824a2df20a405355696022398216fa4f 100644 ---- a/test/parallel/test-crypto-prime.js -+++ b/test/parallel/test-crypto-prime.js -@@ -259,11 +259,11 @@ for (const checks of [-(2 ** 31), -1, 2 ** 31, 2 ** 32 - 1, 2 ** 32, 2 ** 50]) { - bytes[0] = 0x1; - assert.throws(() => checkPrime(bytes, common.mustNotCall()), { - code: 'ERR_OSSL_BN_BIGNUM_TOO_LONG', -- message: /bignum too long/ -+ message: /bignum[_ ]too[_ ]long/i - }); - assert.throws(() => checkPrimeSync(bytes), { - code: 'ERR_OSSL_BN_BIGNUM_TOO_LONG', -- message: /bignum too long/ -+ message: /bignum[_ ]too[_ ]long/i - }); - } - diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d754b8d01 100644 --- a/test/parallel/test-crypto-rsa-dsa.js @@ -353,10 +335,10 @@ index dcd5045daaf58c60e27c1e2f7941033302241339..6ac75565792b92a97c622baba73f821d // DSA signatures vary across runs so there is no static string to verify diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js -index 338a19b0e88ad6f08d2f6b6a5d38b9980996ce11..a4ee215575d072450ba66c558ddca88bfb23d85f 100644 +index 03a18c7522531c7317f12705550117dc389a0245..2f0f46f2c6ddc62de89877cfa0ca80949a0f4c5e 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js -@@ -178,7 +178,7 @@ for (const options of bad) { +@@ -176,7 +176,7 @@ for (const options of bad) { for (const options of toobig) { const expected = { @@ -599,6 +581,49 @@ index 6f88e81e9ff29defe73800fc038b0d96d1ebd846..c0b92e2bdf86d3d2638c973f8be3110d }; // Create TLS1.2 server +diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js +index cba5bebaa29b6f8ac4fd0fcedaadb2f7bb3eb321..019d95df499892b14ab088f99013ee32c432779c 100644 +--- a/test/parallel/test-tls-alert-handling.js ++++ b/test/parallel/test-tls-alert-handling.js +@@ -35,7 +35,7 @@ let iter = 0; + + const errorHandler = common.mustCall((err) => { + let expectedErrorCode = 'ERR_SSL_WRONG_VERSION_NUMBER'; +- let expectedErrorReason = 'wrong version number'; ++ let expectedErrorReason = /wrong[\s_]version[\s_]number/i; + if (hasOpenSSL(3, 2)) { + expectedErrorCode = 'ERR_SSL_PACKET_LENGTH_TOO_LONG'; + expectedErrorReason = 'packet length too long'; +@@ -43,8 +43,8 @@ const errorHandler = common.mustCall((err) => { + + assert.strictEqual(err.code, expectedErrorCode); + assert.strictEqual(err.library, 'SSL routines'); +- if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record'); +- assert.strictEqual(err.reason, expectedErrorReason); ++ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL) assert.strictEqual(err.function, 'ssl3_get_record'); ++ assert.match(err.reason, expectedErrorReason); + errorReceived = true; + if (canCloseServer()) + server.close(); +@@ -98,15 +98,15 @@ function sendBADTLSRecord() { + })); + client.on('error', common.mustCall((err) => { + let expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION'; +- let expectedErrorReason = 'tlsv1 alert protocol version'; ++ let expectedErrorReason = /tlsv1[\s_]alert[\s_]protocol[\s_]version/i; + if (hasOpenSSL(3, 2)) { + expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_RECORD_OVERFLOW'; + expectedErrorReason = 'tlsv1 alert record overflow'; + } + assert.strictEqual(err.code, expectedErrorCode); + assert.strictEqual(err.library, 'SSL routines'); +- if (!hasOpenSSL3) ++ if (!hasOpenSSL3 && !common.openSSLIsBoringSSL) + assert.strictEqual(err.function, 'ssl3_read_bytes'); +- assert.strictEqual(err.reason, expectedErrorReason); ++ assert.match(err.reason, expectedErrorReason); + })); + } diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index b1eab88fd6517e3698934dea17752ef2bb8d8d54..3ad6db20316baa8490e3787dd55903b58a54ad06 100644 --- a/test/parallel/test-tls-getprotocol.js diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch index 73608aa7e06e..68ec69cf3ee8 100644 --- a/patches/node/fix_do_not_resolve_electron_entrypoints.patch +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -19,10 +19,10 @@ index c9d4a3536d0f60375ae623b48ca2fa7095c88d42..d818320fbbc430d06a0c2852e4723981 context = { __proto__: context, source }; } diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index 0caba80bb213e0edfb1f834250f895ccc05d0d1c..6feab19d24a3524e36c5ed3bbac53cba0fa298c7 100644 +index 49aacb6262502ced54e817f99dd596db85b9659c..f9f065bb743275e9b2ce71375e6a9f06e00c0f36 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js -@@ -286,6 +286,9 @@ function cjsPreparseModuleExports(filename, source) { +@@ -291,6 +291,9 @@ function cjsPreparseModuleExports(filename, source, isMain, format) { if (module && module[kModuleExportNames] !== undefined) { return { module, exportNames: module[kModuleExportNames] }; } diff --git a/patches/node/fix_expose_readfilesync_override_for_modules.patch b/patches/node/fix_expose_readfilesync_override_for_modules.patch index d30767517d58..c54548cd8b87 100644 --- a/patches/node/fix_expose_readfilesync_override_for_modules.patch +++ b/patches/node/fix_expose_readfilesync_override_for_modules.patch @@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules` binding. diff --git a/src/env_properties.h b/src/env_properties.h -index 9f89823170782242093bc5ee0df6a2a2ef5b919f..b9374ee1acceb3d0aab51c6c5ae6a79be1cc71a9 100644 +index ba8c80ff2842c63f16cae51cfa8084617bb35bf5..820aebd18d22bcef4992b09ffc8924e9b758fd3e 100644 --- a/src/env_properties.h +++ b/src/env_properties.h -@@ -478,6 +478,7 @@ +@@ -485,6 +485,7 @@ V(maybe_cache_generated_source_map, v8::Function) \ V(messaging_deserialize_create_object, v8::Function) \ V(message_port, v8::Object) \ diff --git a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch index f6652a3aeefa..baa89612d412 100644 --- a/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch +++ b/patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch @@ -70,19 +70,19 @@ index bfd9bd3d127404de1cbb6f30c43ab0342590759d..9e7d8ef0adef3b68a3ec186e4b218f59 const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true }); diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index a587246e329b41f33a3fdfe5ef92910915911611..1b94d923b6d83cc7806d793497a4f9f978c5938c 100644 +index 7dcd7afe8ce3c25ceb314cdf15c330f3d66eb84f..4445bcc4c4c6c6f87ac45e693012a18a93739f9b 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js -@@ -182,7 +182,7 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { +@@ -186,7 +186,7 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul - const { exportNames, module } = cjsPreparseModuleExports(filename, source); + const { exportNames, module } = cjsPreparseModuleExports(filename, source, isMain, format); cjsCache.set(url, module); - const namesWithDefault = exportNames.has('default') ? + const namesWithDefault = filename === 'electron' ? ['default', ...Object.keys(module.exports)] : exportNames.has('default') ? [...exportNames] : ['default', ...exportNames]; if (isMain) { -@@ -204,8 +204,8 @@ function createCJSModuleWrap(url, source, isMain, loadCJS = loadCJSModule) { +@@ -208,8 +208,8 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul ({ exports } = module); } for (const exportName of exportNames) { @@ -93,8 +93,8 @@ index a587246e329b41f33a3fdfe5ef92910915911611..1b94d923b6d83cc7806d793497a4f9f9 continue; } // We might trigger a getter -> dont fail. -@@ -239,6 +239,10 @@ translators.set('require-commonjs', (url, source, isMain) => { - return createCJSModuleWrap(url, source); +@@ -243,6 +243,10 @@ translators.set('require-commonjs', (url, source, isMain) => { + return createCJSModuleWrap(url, source, isMain, 'commonjs'); }); +translators.set('electron', () => { diff --git a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch index cdd487fd9f6c..3d8bea2f74f9 100644 --- a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch +++ b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch @@ -238,20 +238,10 @@ index d94f6e1c82c4a62547b3b395f375c86ce4deb5de..b81b9005365272217c77e2b9289bd9f8 X509View ca(sk_X509_value(peer_certs.get(), i)); if (!cert->view().isIssuedBy(ca)) continue; diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc -index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd615183288a 100644 +index a054e4c1285208c9ba8b9679c284f459f1ace690..3de8ef4fafcdbdc2cb0ce31de162663d5272340f 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc -@@ -26,7 +26,9 @@ using ncrypto::BIOPointer; - using ncrypto::ClearErrorOnReturn; - using ncrypto::CryptoErrorList; - using ncrypto::DHPointer; -+#ifndef OPENSSL_NO_ENGINE - using ncrypto::EnginePointer; -+#endif // !OPENSSL_NO_ENGINE - using ncrypto::EVPKeyPointer; - using ncrypto::MarkPopErrorOnReturn; - using ncrypto::SSLPointer; -@@ -105,7 +107,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, +@@ -123,7 +123,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, // the CA certificates. SSL_CTX_clear_extra_chain_certs(ctx); @@ -260,7 +250,7 @@ index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd61 X509* ca = sk_X509_value(extra_certs, i); // NOTE: Increments reference count on `ca` -@@ -931,11 +933,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { +@@ -1584,11 +1584,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { // If the user specified "auto" for dhparams, the JavaScript layer will pass // true to this function instead of the original string. Any other string // value will be interpreted as custom DH parameters below. @@ -274,7 +264,7 @@ index c89d591c6804ab7d41199d61452d10d12cdf7398..05740c7dc599954bca0779b8c8d6bd61 DHPointer dh; { BIOPointer bio(LoadBIO(env, args[0])); -@@ -1161,7 +1164,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { +@@ -1814,7 +1815,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { } // Add CA certs too @@ -416,7 +406,7 @@ index 471fee77531139ce988292470dff443fdfb05b07..931f7c2ae3d7e12afce471545d610d22 return EVPKeyCtxPointer(); diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc -index f66c57b1079af6cd040dc6d11e72f353507b75e5..abd2bccb9669e06dd8355f66220f8b06c8e863dc 100644 +index b38a9a377738fd5fe6cc89c3a27c403bf6a97715..0cd43c2005b431e180b7483cb89825a75e1fe03f 100644 --- a/src/crypto/crypto_keys.cc +++ b/src/crypto/crypto_keys.cc @@ -949,6 +949,7 @@ void KeyObjectHandle::GetAsymmetricKeyType( @@ -469,20 +459,20 @@ index 05a3882c7e17d78e27aabb29891aa250789a47c0..1f2fccce6ed8f14525557644e0bdd130 if (target diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f7268d89c 100644 +index 7c548d32b40365343f0e208c3aa856a1c847f4c3..6346f8f7199cf7b7d3736c59571606fff102fbb6 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -29,7 +29,9 @@ namespace node { - using ncrypto::BignumPointer; - using ncrypto::BIOPointer; - using ncrypto::CryptoErrorList; -+#ifndef OPENSSL_NO_ENGINE - using ncrypto::EnginePointer; -+#endif // !OPENSSL_NO_ENGINE - using ncrypto::EVPKeyCtxPointer; - using v8::ArrayBuffer; - using v8::BackingStore; -@@ -502,24 +504,15 @@ Maybe Decorate(Environment* env, +@@ -207,7 +207,8 @@ void TestFipsCrypto(const v8::FunctionCallbackInfo& args) { + + void GetOpenSSLSecLevelCrypto(const FunctionCallbackInfo& args) { + // for BoringSSL assume the same as the default +- int sec_level = OPENSSL_TLS_SECURITY_LEVEL; ++ // value of OPENSSL_TLS_SECURITY_LEVEL. ++ int sec_level = 1; + #ifndef OPENSSL_IS_BORINGSSL + Environment* env = Environment::GetCurrent(args); + +@@ -527,24 +528,15 @@ Maybe Decorate(Environment* env, V(BIO) \ V(PKCS7) \ V(X509V3) \ @@ -508,7 +498,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f V(USER) \ #define V(name) case ERR_LIB_##name: lib = #name "_"; break; -@@ -661,7 +654,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -686,7 +678,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); uint32_t len = args[0].As()->Value(); @@ -517,7 +507,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f if (data == nullptr) { // There's no memory available for the allocation. // Return nothing. -@@ -672,7 +665,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -697,7 +689,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { data, len, [](void* data, size_t len, void* deleter_data) { @@ -526,7 +516,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f }, data); Local buffer = ArrayBuffer::New(env->isolate(), store); -@@ -680,10 +673,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -705,10 +697,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { } void SecureHeapUsed(const FunctionCallbackInfo& args) { @@ -540,7 +530,7 @@ index e255288f6e013ce122f317c415d73d9c93d38580..25fa9af8153852f49d5289aa253f3c8f } // namespace diff --git a/src/env.h b/src/env.h -index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a3a353a00 100644 +index b6bdff9b8580d2588a39f00b594c4c480157d78a..cfe917c797a6e4bb0f0284ec56be82637f840129 100644 --- a/src/env.h +++ b/src/env.h @@ -50,7 +50,7 @@ @@ -552,7 +542,7 @@ index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a #include #endif -@@ -1071,7 +1071,7 @@ class Environment final : public MemoryRetainer { +@@ -1073,7 +1073,7 @@ class Environment final : public MemoryRetainer { kExitInfoFieldCount }; @@ -562,7 +552,7 @@ index 1239cbdbf2d375a50ada37ee0ed5592c751d4c5c..aed066852d7c257076cc7ca8b173fd2a // We declare another alias here to avoid having to include crypto_util.h using EVPMDPointer = DeleteFnPtr; diff --git a/src/node_metadata.h b/src/node_metadata.h -index c59e65ad1fe3fac23f1fc25ca77e6133d1ccaccd..f2f07434e076e2977755ef7dac7d489aedb760b0 100644 +index 6f8cb433ff8059c63d5cf16c8783139ae92fbf61..603ac3dde7d1a1109afbc451b69c8d0935b81641 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -6,7 +6,7 @@ @@ -575,7 +565,7 @@ index c59e65ad1fe3fac23f1fc25ca77e6133d1ccaccd..f2f07434e076e2977755ef7dac7d489a #if NODE_OPENSSL_HAS_QUIC #include diff --git a/src/node_options.cc b/src/node_options.cc -index 1d81079a9b7d8a69ad2d87835090be88ae507bd8..3608ab2b4aeb09e985ca98e23f2dff23567ade71 100644 +index 1444acd59d42f64831cead5f153419f7c12a88bf..23cb558a22b4462f5ce4f74833d25c7f712f8139 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -6,7 +6,7 @@ @@ -588,7 +578,7 @@ index 1d81079a9b7d8a69ad2d87835090be88ae507bd8..3608ab2b4aeb09e985ca98e23f2dff23 #endif diff --git a/src/node_options.h b/src/node_options.h -index 621f5eca96b10685734a39e56cce7cee6c8a25bf..41dd04f5e2b1cd54c32df70830389d44d7b39aa2 100644 +index e68a41b60832c4b000e17dd15ce16c1bdaf4b54b..065457acfde6ba4d04ed570cc72005cfd2798fd5 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -11,7 +11,7 @@ @@ -600,24 +590,3 @@ index 621f5eca96b10685734a39e56cce7cee6c8a25bf..41dd04f5e2b1cd54c32df70830389d44 #include "openssl/opensslv.h" #endif -diff --git a/unofficial.gni b/unofficial.gni -index a2f3a769ceaa08db6d7438223884dc5aeab1340d..08603eaef2da51fd92f9bf977647b56409eff48c 100644 ---- a/unofficial.gni -+++ b/unofficial.gni -@@ -151,7 +151,6 @@ template("node_gn_build") { - ] - deps = [ - ":run_node_js2c", -- "deps/brotli", - "deps/cares", - "deps/histogram", - "deps/llhttp", -@@ -161,6 +160,8 @@ template("node_gn_build") { - "deps/sqlite", - "deps/uvwasi", - "//third_party/zlib", -+ "//third_party/brotli:dec", -+ "//third_party/brotli:enc", - "$node_simdutf_path", - "$node_v8_path:v8_libplatform", - ] diff --git a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch index fa54a035afce..8de78da28f2f 100644 --- a/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch +++ b/patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch @@ -60,7 +60,7 @@ index 9e7d8ef0adef3b68a3ec186e4b218f591aa69266..2879e5cf541fb4d226cfd7cc0fe367ca }); const { search, hash } = resolved; diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js -index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895ccc05d0d1c 100644 +index 4445bcc4c4c6c6f87ac45e693012a18a93739f9b..49aacb6262502ced54e817f99dd596db85b9659c 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -24,7 +24,7 @@ const { @@ -69,10 +69,10 @@ index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895cc const assert = require('internal/assert'); -const { readFileSync } = require('fs'); +const fs = require('fs'); - const { dirname, extname, isAbsolute } = require('path'); + const { dirname, extname } = require('path'); const { assertBufferSource, -@@ -268,7 +268,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) { +@@ -272,7 +272,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) { try { // We still need to read the FS to detect the exports. @@ -81,12 +81,3 @@ index 1b94d923b6d83cc7806d793497a4f9f978c5938c..0caba80bb213e0edfb1f834250f895cc } catch { // Continue regardless of error. } -@@ -335,7 +335,7 @@ function cjsPreparseModuleExports(filename, source) { - isAbsolute(resolved)) { - // TODO: this should be calling the `load` hook chain to get the source - // (and fallback to reading the FS only if the source is nullish). -- const source = readFileSync(resolved, 'utf-8'); -+ const source = fs.readFileSync(resolved, 'utf-8'); - const { exportNames: reexportNames } = cjsPreparseModuleExports(resolved, source); - for (const name of reexportNames) { - exportNames.add(name); diff --git a/patches/node/fix_remove_deprecated_errno_constants.patch b/patches/node/fix_remove_deprecated_errno_constants.patch index ab580184a317..0e9ce33bc3b4 100644 --- a/patches/node/fix_remove_deprecated_errno_constants.patch +++ b/patches/node/fix_remove_deprecated_errno_constants.patch @@ -86,7 +86,7 @@ index 13263149c111beede83b7063fa54f56655aea54c..99068098e1867af4846e18a5d039a256 NODE_DEFINE_CONSTANT(target, ETIMEDOUT); #endif diff --git a/src/node_errors.cc b/src/node_errors.cc -index 609601328f7f5ff5f121151e81c2df82e7ef4253..6b9b944c11af917fe4e296961e6ed7df7b89a123 100644 +index 5f51add4cdf68a9487edfc9382f586cc94539571..befb642f1effa3c4139e4cd99ff64d9c5175fd72 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -862,10 +862,6 @@ const char* errno_string(int errorno) { diff --git a/patches/node/fix_remove_fastapitypedarray_usage.patch b/patches/node/fix_remove_fastapitypedarray_usage.patch index b1dad662b716..7ce2dea2c4fe 100644 --- a/patches/node/fix_remove_fastapitypedarray_usage.patch +++ b/patches/node/fix_remove_fastapitypedarray_usage.patch @@ -48,7 +48,7 @@ index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18 static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual)); diff --git a/src/node_buffer.cc b/src/node_buffer.cc -index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe8b747a61 100644 +index 10659fbf57e4535736fc001c0dbdd9b93e8f60f1..c0bd975bae23d1c05ace42fd8c9846ee4d8ef8f0 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -44,6 +44,14 @@ @@ -74,7 +74,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe using v8::FunctionCallbackInfo; using v8::Global; using v8::HandleScope; -@@ -582,19 +589,24 @@ void SlowCopy(const FunctionCallbackInfo& args) { +@@ -586,19 +593,24 @@ void SlowCopy(const FunctionCallbackInfo& args) { // Assume caller has properly validated args. uint32_t FastCopy(Local receiver, @@ -107,7 +107,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe return to_copy; } -@@ -858,19 +870,17 @@ void Compare(const FunctionCallbackInfo &args) { +@@ -867,19 +879,17 @@ void Compare(const FunctionCallbackInfo &args) { } int32_t FastCompare(v8::Local, @@ -135,7 +135,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe } static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare)); -@@ -1141,14 +1151,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo& args) { +@@ -1150,14 +1160,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo& args) { } int32_t FastIndexOfNumber(v8::Local, @@ -153,7 +153,7 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe } static v8::CFunction fast_index_of_number( -@@ -1501,21 +1510,31 @@ void SlowWriteString(const FunctionCallbackInfo& args) { +@@ -1511,21 +1520,31 @@ void SlowWriteString(const FunctionCallbackInfo& args) { template uint32_t FastWriteString(Local receiver, @@ -194,10 +194,10 @@ index cd51d9acf9540d506ec35812b9d2c530fce24912..07068344262f7b73a83073d4da75bffe static v8::CFunction fast_write_string_ascii( diff --git a/src/node_external_reference.h b/src/node_external_reference.h -index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f6460a1b3a4d 100644 +index bb007dbdcce486659afeed07b78103e44b00307b..314a4ded6908a94107de1ae1e550b7d46afdce75 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h -@@ -40,16 +40,16 @@ using CFunctionCallbackWithStrings = +@@ -43,16 +43,16 @@ using CFunctionCallbackWithStrings = const v8::FastOneByteString& base); using CFunctionCallbackWithTwoUint8Arrays = int32_t (*)(v8::Local, @@ -219,7 +219,7 @@ index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f646 uint32_t, int64_t, bool); -@@ -68,18 +68,20 @@ using CFunctionWithBool = void (*)(v8::Local, +@@ -71,18 +71,20 @@ using CFunctionWithBool = void (*)(v8::Local, using CFunctionWriteString = uint32_t (*)(v8::Local receiver, @@ -246,7 +246,7 @@ index 8d49a119c218323674e29a522ecf71bd22cdaf1b..d39693f2f45f39e45960453112b0f646 // This class manages the external references from the V8 heap // to the C++ addresses in Node.js. diff --git a/src/util.h b/src/util.h -index 0d4676ddade8d91d101b6aeb8763886a234f0bae..7af9ed01a919927ae3897d4989206ec23cfe50d3 100644 +index 48d3c7b8a304049cdb4d4ab2c027b300dc533dc0..f9d5a5b36701b3c65fda65ed8920521ff68e32cd 100644 --- a/src/util.h +++ b/src/util.h @@ -59,6 +59,7 @@ @@ -257,7 +257,7 @@ index 0d4676ddade8d91d101b6aeb8763886a234f0bae..7af9ed01a919927ae3897d4989206ec2 #ifdef _WIN32 /* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */ -@@ -579,6 +580,16 @@ class BufferValue : public MaybeStackBuffer { +@@ -584,6 +585,16 @@ class BufferValue : public MaybeStackBuffer { static_cast(name->Buffer()->Data()) + name##_offset; \ if (name##_length > 0) CHECK_NE(name##_data, nullptr); diff --git a/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch index 593eb1542b25..adb0fcc8506a 100644 --- a/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch +++ b/patches/node/fix_remove_harmony-import-assertions_from_node_cc.patch @@ -11,7 +11,7 @@ This patch can be removed when we upgrade to a V8 version that contains the above CL. diff --git a/src/node.cc b/src/node.cc -index f4365c0eda7330bd02a921608951902f41004f77..b2b10ffb572f010992f221de752618fd56b5d50e 100644 +index a0f1deadfc58f18f23467889680219360386f9dd..8da5f5344051663f92d72848fbac9d041ac4fac3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -808,7 +808,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector* args, diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index c6c29f00a2ea..024cfdbfdddd 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -6,10 +6,10 @@ Subject: Pass all globals through "require" (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 62c33730ed17cb98b6dd8d69b61360a419518ba5..9b5772fe9b8babbb892c7a5ec79258472da55a76 100644 +index 33385fa792b71ea3802904dd3c59ce845342c595..92b368394e17a9257578cd5b7422391689732d6d 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -185,6 +185,13 @@ const { +@@ -200,6 +200,13 @@ const { CHAR_FORWARD_SLASH, } = require('internal/constants'); @@ -23,7 +23,7 @@ index 62c33730ed17cb98b6dd8d69b61360a419518ba5..9b5772fe9b8babbb892c7a5ec7925847 const { isProxy, } = require('internal/util/types'); -@@ -1549,10 +1556,12 @@ Module.prototype._compile = function(content, filename, format) { +@@ -1725,10 +1732,12 @@ Module.prototype._compile = function(content, filename, format) { if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) { const { callAndPauseOnStart } = internalBinding('inspector'); result = callAndPauseOnStart(compiledWrapper, thisValue, exports, diff --git a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch index 091bdc3abcec..e7344756b385 100644 --- a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch +++ b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch @@ -7,10 +7,10 @@ We use this to allow node's 'fs' module to read from ASAR files as if they were a real filesystem. diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js -index f5c0208864084a234a05898e793845681b6e80cc..48d809f61eaf09097acb3e996e956e39cf7b4ef3 100644 +index 4fd535f730e6382672b853bf2098b3fefc1f83b4..bd6724de52ee1f01fa42084c7652c71054f0a9c6 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js -@@ -134,6 +134,10 @@ process.domain = null; +@@ -132,6 +132,10 @@ process.domain = null; } process._exiting = false; diff --git a/patches/node/refactor_attach_cppgc_heap_on_v8_isolate_creation.patch b/patches/node/refactor_attach_cppgc_heap_on_v8_isolate_creation.patch index 7ed48324d3c3..7d775d9ef61b 100644 --- a/patches/node/refactor_attach_cppgc_heap_on_v8_isolate_creation.patch +++ b/patches/node/refactor_attach_cppgc_heap_on_v8_isolate_creation.patch @@ -18,7 +18,7 @@ This can be removed when Node.js upgrades to a version of V8 containing CLs from the above issue. diff --git a/src/api/environment.cc b/src/api/environment.cc -index 9b155213ce301df7e396a4a113992499fc7e9910..8fe560014216f1fcea7f6e804816765999cebaa2 100644 +index 7f4f233b26425493a58ce71dfc0c3a92b7c0bef8..c3f422c6b212bf737a906d2a89df85b63c218617 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -312,6 +312,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params, @@ -47,10 +47,10 @@ index 9b155213ce301df7e396a4a113992499fc7e9910..8fe560014216f1fcea7f6e8048167659 event_loop, platform, diff --git a/src/env.cc b/src/env.cc -index 1c1062a3996f2bb7de9e91f7f4385c8f8d20f490..b0156ee26c29ebe5b79c97834f3bfe8b56df50c6 100644 +index ddf82c8a18c29c355641e33974c1e5e67867379d..ae43803d8c2de90fb191a8e10605f6f3b18816ed 100644 --- a/src/env.cc +++ b/src/env.cc -@@ -575,14 +575,6 @@ IsolateData::IsolateData(Isolate* isolate, +@@ -577,14 +577,6 @@ IsolateData::IsolateData(Isolate* isolate, // We do not care about overflow since we just want this to be different // from the cppgc id. uint16_t non_cppgc_id = cppgc_id + 1; @@ -65,12 +65,13 @@ index 1c1062a3996f2bb7de9e91f7f4385c8f8d20f490..b0156ee26c29ebe5b79c97834f3bfe8b { // GC could still be run after the IsolateData is destroyed, so we store // the ids in a static map to ensure pointers to them are still valid -@@ -605,14 +597,6 @@ IsolateData::IsolateData(Isolate* isolate, +@@ -607,15 +599,6 @@ IsolateData::IsolateData(Isolate* isolate, } } -IsolateData::~IsolateData() { - if (cpp_heap_ != nullptr) { +- v8::Locker locker(isolate_); - // The CppHeap must be detached before being terminated. - isolate_->DetachCppHeap(); - cpp_heap_->Terminate(); @@ -81,7 +82,7 @@ index 1c1062a3996f2bb7de9e91f7f4385c8f8d20f490..b0156ee26c29ebe5b79c97834f3bfe8b void SetCppgcReference(Isolate* isolate, Local object, diff --git a/src/env.h b/src/env.h -index 1f8dc8f88d40ca95ba13d6517b2b5ed83184e1ce..ec3a813b3b864a0eda2e4aa0748b1447001fca9a 100644 +index 9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f..c429eecd937d1df32a2ff90bc0a22a2e58df3a3d 100644 --- a/src/env.h +++ b/src/env.h @@ -155,7 +155,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { @@ -101,7 +102,7 @@ index 1f8dc8f88d40ca95ba13d6517b2b5ed83184e1ce..ec3a813b3b864a0eda2e4aa0748b1447 worker::Worker* worker_context_ = nullptr; PerIsolateWrapperData* wrapper_data_; diff --git a/src/node.cc b/src/node.cc -index b2b10ffb572f010992f221de752618fd56b5d50e..0ed78ab6b52906e980eebf1f625a1c7cbfc8097b 100644 +index 8da5f5344051663f92d72848fbac9d041ac4fac3..2f58a6fa69069dabb99b5ddb8011991b07fa5f02 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1222,10 +1222,6 @@ InitializeOncePerProcessInternal(const std::vector& args, @@ -263,10 +264,10 @@ index edd413ae9b956b2e59e8166785adef6a8ff06d51..d1c1549efcb0320bc0f7d354db2101ac // Check that all the objects are created and destroyed properly. EXPECT_EQ(CppGCed::kConstructCount, 100); diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc -index 14e82cc80ff73084fb43b2ef07febfd2667a0abc..b6a92f1685d1083c8f0c0b3ed110509f6d76b59f 100644 +index 008cda77b650dc2d904ae00e7629b5ad05d297ad..103931516cea9beb7f25c53526928e67b3c90d2d 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc -@@ -623,6 +623,9 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { +@@ -625,6 +625,9 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { // Allocate and initialize Isolate. v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = allocator.get(); @@ -276,7 +277,7 @@ index 14e82cc80ff73084fb43b2ef07febfd2667a0abc..b6a92f1685d1083c8f0c0b3ed110509f v8::Isolate* isolate = v8::Isolate::Allocate(); CHECK_NOT_NULL(isolate); platform->RegisterIsolate(isolate, ¤t_loop); -@@ -672,8 +675,8 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { +@@ -675,8 +678,8 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) { } // Cleanup. @@ -287,10 +288,10 @@ index 14e82cc80ff73084fb43b2ef07febfd2667a0abc..b6a92f1685d1083c8f0c0b3ed110509f #endif // _WIN32 diff --git a/test/cctest/test_platform.cc b/test/cctest/test_platform.cc -index c2d7893813000601502d050f21ad5c740c6a3b8f..3042f63201bd0df3ad316e09f0f54e210cea8831 100644 +index 53644accf29749bf8fc18b641ae1eaef93cd6f98..7e5b143fb4b633e18a4b2d7440cba7e077c50950 100644 --- a/test/cctest/test_platform.cc +++ b/test/cctest/test_platform.cc -@@ -101,8 +101,8 @@ TEST_F(NodeZeroIsolateTestFixture, IsolatePlatformDelegateTest) { +@@ -102,8 +102,8 @@ TEST_F(NodeZeroIsolateTestFixture, IsolatePlatformDelegateTest) { // Graceful shutdown delegate->Shutdown(); diff --git a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch index b99712eaf254..eb31ed5e0e4a 100644 --- a/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch +++ b/patches/node/src_remove_dependency_on_wrapper-descriptor-based_cppheap.patch @@ -16,7 +16,7 @@ patch: (cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326) diff --git a/src/env-inl.h b/src/env-inl.h -index 49c3513ee9b67b407a2bb6609ac89a5959a78cd1..9a8216354e646e86d692b25c2bed5134e267528c 100644 +index d4b211dfb2f77a65f311701d95365e66d92f8875..4c1a5f2b92d7fdddb8c2e7bbfd6788fdff3645b9 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const { @@ -52,7 +52,7 @@ index 49c3513ee9b67b407a2bb6609ac89a5959a78cd1..9a8216354e646e86d692b25c2bed5134 return &(wrapper_data_->cppgc_id); } diff --git a/src/env.cc b/src/env.cc -index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f8d20f490 100644 +index f8c24e422756d5101a258175a2f28a96648bea47..ddf82c8a18c29c355641e33974c1e5e67867379d 100644 --- a/src/env.cc +++ b/src/env.cc @@ -23,6 +23,7 @@ @@ -63,7 +63,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f #include #include -@@ -70,7 +71,6 @@ using v8::TryCatch; +@@ -72,7 +73,6 @@ using v8::TryCatch; using v8::Uint32; using v8::Undefined; using v8::Value; @@ -71,7 +71,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f using worker::Worker; int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64; -@@ -527,6 +527,14 @@ void IsolateData::CreateProperties() { +@@ -529,6 +529,14 @@ void IsolateData::CreateProperties() { CreateEnvProxyTemplate(this); } @@ -86,7 +86,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f constexpr uint16_t kDefaultCppGCEmbedderID = 0x90de; Mutex IsolateData::isolate_data_mutex_; std::unordered_map> -@@ -564,36 +572,16 @@ IsolateData::IsolateData(Isolate* isolate, +@@ -566,36 +574,16 @@ IsolateData::IsolateData(Isolate* isolate, v8::CppHeap* cpp_heap = isolate->GetCppHeap(); uint16_t cppgc_id = kDefaultCppGCEmbedderID; @@ -130,7 +130,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f { // GC could still be run after the IsolateData is destroyed, so we store -@@ -625,11 +613,12 @@ IsolateData::~IsolateData() { +@@ -628,11 +616,12 @@ IsolateData::~IsolateData() { } } @@ -146,7 +146,7 @@ index b428c922ed218cbdf19cdba50d18b1f81a56b8ca..1c1062a3996f2bb7de9e91f7f4385c8f void IsolateData::MemoryInfo(MemoryTracker* tracker) const { diff --git a/src/env.h b/src/env.h -index aed066852d7c257076cc7ca8b173fd2a3a353a00..1f8dc8f88d40ca95ba13d6517b2b5ed83184e1ce 100644 +index cfe917c797a6e4bb0f0284ec56be82637f840129..9f1c7ef45b6df10f811936a78ea6d9fcc13fef4f 100644 --- a/src/env.h +++ b/src/env.h @@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer { @@ -161,10 +161,10 @@ index aed066852d7c257076cc7ca8b173fd2a3a353a00..1f8dc8f88d40ca95ba13d6517b2b5ed8 inline MultiIsolatePlatform* platform() const; inline const SnapshotData* snapshot_data() const; diff --git a/src/node.h b/src/node.h -index 120e3a1042e29590cbbf4be258a1cd2d3d4f0043..afb26ec5690ccd65a3c36f8b8a1b2de416b9d843 100644 +index bdc77f8eb7abffa9e6c98cd254daedad3e44b981..98ad0ea649eaef43d1f5231f7bc4044e100e08d7 100644 --- a/src/node.h +++ b/src/node.h -@@ -1552,24 +1552,14 @@ void RegisterSignalHandler(int signal, +@@ -1553,24 +1553,14 @@ void RegisterSignalHandler(int signal, bool reset_handler = false); #endif // _WIN32 diff --git a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch index 8c61c3b3d788..1e68d7e6b68f 100644 --- a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch +++ b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch @@ -40,10 +40,10 @@ index 0f0cde7be431dcb80c5314b1a9da49886c436d1c..f6d2bd439cad8b9f91c9d9a6cdb302e6 } HistogramBase* histogram; diff --git a/src/node_file.cc b/src/node_file.cc -index 3d7e303741a73134e140152bed637fe5ae8bc1db..5e744bc34b9dc364e8f20adfd37ee41d76451170 100644 +index c7915e2c8161a5d0fa05ccce368ce9c44345c05d..23347379328794467a497c86cbae0b428b7ba791 100644 --- a/src/node_file.cc +++ b/src/node_file.cc -@@ -1061,13 +1061,8 @@ static int32_t FastInternalModuleStat( +@@ -1071,13 +1071,8 @@ static int32_t FastInternalModuleStat( // NOLINTNEXTLINE(runtime/references) This is V8 api. FastApiCallbackOptions& options) { // This needs a HandleScope which needs an isolate. @@ -60,10 +60,10 @@ index 3d7e303741a73134e140152bed637fe5ae8bc1db..5e744bc34b9dc364e8f20adfd37ee41d auto path = std::filesystem::path(input.data, input.data + input.length); diff --git a/src/node_wasi.cc b/src/node_wasi.cc -index 468c2e59903fefe58d9c178d3afac3ef5b09f611..23a376e52e08a8af49dd47c47488552e01287426 100644 +index 090866960beb8f1759c99e95536924b8b61fb723..3f91b651b83a20e70d5b368e012f5ee4b9d16092 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc -@@ -251,17 +251,19 @@ R WASI::WasiFunction::FastCallback( +@@ -275,17 +275,19 @@ R WASI::WasiFunction::FastCallback( return EinvalError(); } diff --git a/patches/node/support_v8_sandboxed_pointers.patch b/patches/node/support_v8_sandboxed_pointers.patch index 100326397f40..f909667671ec 100644 --- a/patches/node/support_v8_sandboxed_pointers.patch +++ b/patches/node/support_v8_sandboxed_pointers.patch @@ -7,7 +7,7 @@ This refactors several allocators to allocate within the V8 memory cage, allowing them to be compatible with the V8_SANDBOXED_POINTERS feature. diff --git a/src/api/environment.cc b/src/api/environment.cc -index ad323fc800a33c010b0504a4aa55c107498dee26..fc9b056d2f7e25109100fbde5f3ab0aebc8c619a 100644 +index 88c2c932a6b045317c83c911b1cd8267b60d9334..7f4f233b26425493a58ce71dfc0c3a92b7c0bef8 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -102,6 +102,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, @@ -64,10 +64,10 @@ index 5387d9625a28bb7d11f7f0f05a5f07d1fee2c216..1b3b8c7b70073926f8dbf02759c2e1af return Buffer::New(env, ab, 0, ab->ByteLength()).FromMaybe(Local()); } diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0c8d93af3 100644 +index 6346f8f7199cf7b7d3736c59571606fff102fbb6..7eea2eaefcad5780663a6b87985925ae5d70a5f9 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -335,10 +335,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { +@@ -359,10 +359,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { return *this; } @@ -104,7 +104,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0 std::unique_ptr ptr = ArrayBuffer::NewBackingStore( allocated_data_, size(), -@@ -350,10 +375,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { +@@ -374,10 +399,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { data_ = nullptr; size_ = 0; return ptr; @@ -117,7 +117,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0 return ArrayBuffer::New(env->isolate(), std::move(store)); } -@@ -650,6 +676,16 @@ namespace { +@@ -674,6 +700,16 @@ namespace { // in which case this has the same semantics as // using OPENSSL_malloc. However, if the secure heap is // initialized, SecureBuffer will automatically use it. @@ -134,7 +134,7 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0 void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); -@@ -671,6 +707,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -695,6 +731,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { Local buffer = ArrayBuffer::New(env->isolate(), store); args.GetReturnValue().Set(Uint8Array::New(buffer, 0, len)); } @@ -143,10 +143,10 @@ index 25fa9af8153852f49d5289aa253f3c8f7268d89c..a67268f78b18cf71b90b9e31ad733eb0 void SecureHeapUsed(const FunctionCallbackInfo& args) { #ifndef OPENSSL_IS_BORINGSSL diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h -index a5967c7d24b8365eb64ab63ec0b3ef8dc23c727e..2acebc3ac2ed9f631fc572f42f19f2e3dccfeb12 100644 +index b85c8daeb464097c2e93bdc7ffdfcfe16b76234b..470a0c4adadcd092dd0105c384e87917ac6fe69a 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h -@@ -241,7 +241,7 @@ class ByteSource { +@@ -242,7 +242,7 @@ class ByteSource { // Creates a v8::BackingStore that takes over responsibility for // any allocated data. The ByteSource will be reset with size = 0 // after being called. @@ -189,7 +189,7 @@ index 3465454e4de4a78912b81e7eca0de395fbe89911..c8ae863460107c69dd77d67c76c11843 Local ret; if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&ret)) return {}; diff --git a/src/node_i18n.cc b/src/node_i18n.cc -index 0bcf10a0b35accb8d6d5fe9891d4f52b27d40346..606c2021242e6967ea4195af3e2493a7d5745dae 100644 +index ea7810e41e2667713a896250dc1b904b0a7cf198..865b3128c1edfe7074769f25a0b87878ca094f31 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -104,7 +104,7 @@ namespace { @@ -253,7 +253,7 @@ index 382df89a2312f76b5293412a8d51969ae5d9fa9c..1c90da9bbcb9547ab36de4d01088c03f // Delegate to V8's allocator for compatibility with the V8 memory cage. diff --git a/src/node_serdes.cc b/src/node_serdes.cc -index 7a70997bc024efa4f3ff4cabe30d5e88dcc7bc78..6552af3ed0acede41c1b16ef77eb359dc54f088a 100644 +index c55a2e28066147ae5ca5def10ec76ccc03c634b4..c54183c72944989219b6437c9e571a3f7f3f8dd5 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -29,6 +29,26 @@ using v8::ValueSerializer; diff --git a/patches/node/test_formally_mark_some_tests_as_flaky.patch b/patches/node/test_formally_mark_some_tests_as_flaky.patch index 974c8eeeb6c2..5dd458484745 100644 --- a/patches/node/test_formally_mark_some_tests_as_flaky.patch +++ b/patches/node/test_formally_mark_some_tests_as_flaky.patch @@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run but don't cause CI failures on flakes. diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status -index fd42444c7b216a4a1fa026efc1bbc1b5df8c7394..26f78764842aaaa781a9409dda2a7d3265351178 100644 +index cc99efd7a743d683d5210ad83e258560c28cbd16..b2f0f7fb49665f0dc924cdd3e344c2579d617fbf 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -5,6 +5,16 @@ prefix parallel diff --git a/patches/node/test_make_eval_snapshot_tests_more_flexible.patch b/patches/node/test_make_eval_snapshot_tests_more_flexible.patch deleted file mode 100644 index 8d930ce9360d..000000000000 --- a/patches/node/test_make_eval_snapshot_tests_more_flexible.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Wed, 12 Feb 2025 21:01:13 +0100 -Subject: test: make eval snapshot tests more flexible - -Upstreamed in X - -diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot -index f6fc803e0e3ec3f6a0c7cd056f42ac860012c907..998a06584b3bf3648e6703774aeb31c07bdb5d0e 100644 ---- a/test/fixtures/eval/eval_messages.snapshot -+++ b/test/fixtures/eval/eval_messages.snapshot -@@ -35,7 +35,7 @@ Node.js * - var ______________________________________________; throw 10 - ^ - 10 --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * - -@@ -43,7 +43,7 @@ Node.js * - var ______________________________________________; throw 10 - ^ - 10 --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * - done -diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot -index 66bd506f758ca93906f850a9c773b617745eb834..0382a6ae3ccd792523cc19847bbdeef4d53e1579 100644 ---- a/test/fixtures/eval/stdin_messages.snapshot -+++ b/test/fixtures/eval/stdin_messages.snapshot -@@ -40,7 +40,7 @@ Node.js * - let ______________________________________________; throw 10 - ^ - 10 --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * - -@@ -48,7 +48,7 @@ Node.js * - let ______________________________________________; throw 10 - ^ - 10 --(Use `node --trace-uncaught ...` to show where the exception was thrown) -+(Use `* --trace-uncaught ...` to show where the exception was thrown) - - Node.js * - done -diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs -index d8c52176b1c3c3a0664d7f6b6750da03aa960587..8a3cc59574206769e4c80a04f05b03586f511ac2 100644 ---- a/test/parallel/test-node-output-eval.mjs -+++ b/test/parallel/test-node-output-eval.mjs -@@ -1,6 +1,7 @@ - import '../common/index.mjs'; - import * as fixtures from '../common/fixtures.mjs'; - import * as snapshot from '../common/assertSnapshot.js'; -+import { basename } from 'node:path'; - import { describe, it } from 'node:test'; - - describe('eval output', { concurrency: true }, () => { -@@ -16,6 +17,7 @@ describe('eval output', { concurrency: true }, () => { - snapshot.replaceNodeVersion, - removeStackTraces, - filterEmptyLines, -+ generalizeProcessName, - ); - - function removeStackTraces(output) { -@@ -26,6 +28,11 @@ describe('eval output', { concurrency: true }, () => { - return output.replaceAll(/^\s*$/gm, ''); - } - -+ function generalizeProcessName(output) { -+ const baseName = basename(process.argv0 || 'node', '.exe'); -+ return output.replaceAll(`${baseName} --`, '* --'); -+ } -+ - const tests = [ - { name: 'eval/eval_messages.js' }, - { name: 'eval/stdin_messages.js' }, diff --git a/patches/node/zlib_fix_pointer_alignment.patch b/patches/node/zlib_fix_pointer_alignment.patch index 47c51a49e62a..418e74d53ccd 100644 --- a/patches/node/zlib_fix_pointer_alignment.patch +++ b/patches/node/zlib_fix_pointer_alignment.patch @@ -16,10 +16,10 @@ 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 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12fc88137eb 100644 +index 0b7c47b326c7c5480086228b3d40d54c260ef16a..7e6b38ecd1aa360012c0d73e94412530a48cb8c3 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc -@@ -493,7 +493,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { +@@ -608,7 +608,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { } static void* AllocForBrotli(void* data, size_t size) { @@ -29,7 +29,7 @@ index 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12f CompressionStream* ctx = static_cast(data); char* memory = UncheckedMalloc(size); if (memory == nullptr) [[unlikely]] { -@@ -502,7 +503,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { +@@ -617,7 +618,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { *reinterpret_cast(memory) = size; ctx->unreported_allocations_.fetch_add(size, std::memory_order_relaxed); @@ -38,7 +38,7 @@ index 90307cd4984ae5aa55386f2980ad9cd540322dfd..6f12b5034d1a98da50c064cf2cfdf12f } static void FreeForZlib(void* data, void* pointer) { -@@ -510,7 +511,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { +@@ -625,7 +626,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { return; } CompressionStream* ctx = static_cast(data); diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 97852d1ca102..5c23b69386d6 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -31,6 +31,7 @@ "parallel/test-http2-https-fallback", "parallel/test-http2-server-unknown-protocol", "parallel/test-https-agent-session-reuse", + "parallel/test-https-client-renegotiation-limit", "parallel/test-https-options-boolean-check", "parallel/test-icu-env", "parallel/test-icu-minimum-version",