diff --git a/patches/node/.patches b/patches/node/.patches index a2085c7f2ef55..6d55f864cfd11 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -32,3 +32,5 @@ remove_deprecated_task_api_override_removed_in_latest_v8.patch remove_serialization_deserialization_of_wasmmoduleobject.patch 64bit_bump_typedarray_max_length_to_2_32-1_elements.patch override_existing_v8_reallocate.patch +fix_use_hex_not_decimal_for_clarity.patch +fix_explicitly_override_mark_arraybuffer_as_untransferable.patch diff --git a/patches/node/fix_explicitly_override_mark_arraybuffer_as_untransferable.patch b/patches/node/fix_explicitly_override_mark_arraybuffer_as_untransferable.patch new file mode 100644 index 0000000000000..996807ee9d374 --- /dev/null +++ b/patches/node/fix_explicitly_override_mark_arraybuffer_as_untransferable.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 12 Feb 2020 14:23:09 -0800 +Subject: fix: explicitly override mark_arraybuffer_as_untransferable + +We need to mark overridden functions explicitly. This has already been +fixed upstream at https://github.com/nodejs/node/pull/30549. + +diff --git a/src/node_api.cc b/src/node_api.cc +index 0f7981cd5605ae2dad029b6bfb6a032afc09dfe0..5e467dded5bdb75a1831492b6b45c0d5eacab7f2 100644 +--- a/src/node_api.cc ++++ b/src/node_api.cc +@@ -26,7 +26,7 @@ struct node_napi_env__ : public napi_env__ { + } + + v8::Maybe mark_arraybuffer_as_untransferable( +- v8::Local ab) const { ++ v8::Local ab) const override { + return ab->SetPrivate( + context(), + node_env()->arraybuffer_untransferable_private_symbol(), diff --git a/patches/node/fix_use_hex_not_decimal_for_clarity.patch b/patches/node/fix_use_hex_not_decimal_for_clarity.patch new file mode 100644 index 0000000000000..0bc79bdf7a200 --- /dev/null +++ b/patches/node/fix_use_hex_not_decimal_for_clarity.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Wed, 12 Feb 2020 14:19:11 -0800 +Subject: fix: use hex not decimal for clarity + +In Electron, clang enforces -Wxor-used-as-pow, so we should use hex +here to clarify intent for the compiler. + +Upstreamed at https://github.com/nodejs/node/pull/31758. + +diff --git a/src/module_wrap.cc b/src/module_wrap.cc +index b53aab6dc16c7ae42530998c94ddc845035b1256..c6aa5751a1bbaa693b915e418de8eb69ea8139f8 100644 +--- a/src/module_wrap.cc ++++ b/src/module_wrap.cc +@@ -923,7 +923,7 @@ bool IsArrayIndex(Environment* env, Local p) { + if (!n->ToInteger(context).ToLocal(&cmp_integer)) { + return false; + } +- return n_dbl > 0 && n_dbl < (2 ^ 32) - 1; ++ return n_dbl > 0 && n_dbl < (1LL << 32) - 1; + } + + Maybe ResolveExportsTarget(Environment* env,