From beafbfd51115ed6cc2a800461ffb91aea8603e7e Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 29 Mar 2024 13:34:56 +0100 Subject: [PATCH] build: combine `ImportModuleDynamically` patches (#41712) build: combine ImportModuleDynamically patches --- patches/node/.patches | 1 - ...e_expose_importmoduledynamically_and.patch | 16 +++++++++--- .../fix_missing_include_for_node_extern.patch | 26 ------------------- 3 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 patches/node/fix_missing_include_for_node_extern.patch diff --git a/patches/node/.patches b/patches/node/.patches index 09ea299e4b93..fd8ff5225570 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -33,7 +33,6 @@ fix_assert_module_in_the_renderer_process.patch fix_add_trusted_space_and_trusted_lo_space_to_the_v8_heap.patch win_process_avoid_assert_after_spawning_store_app_4152.patch chore_remove_use_of_deprecated_kmaxlength.patch -fix_missing_include_for_node_extern.patch feat_optionally_prevent_calling_v8_enablewebassemblytraphandler.patch build_only_create_cppgc_heap_on_non-32_bit_platforms.patch fix_-wshadow_error_in_uvwasi_c.patch diff --git a/patches/node/chore_expose_importmoduledynamically_and.patch b/patches/node/chore_expose_importmoduledynamically_and.patch index ae6a48547e27..2599c58985f9 100644 --- a/patches/node/chore_expose_importmoduledynamically_and.patch +++ b/patches/node/chore_expose_importmoduledynamically_and.patch @@ -87,10 +87,18 @@ index 895ff3a5948add3513700ecc2f32fce4c2fbe4eb..3182a5e4aad2ba0be2b6769edb696b81 MaybeLocal ModuleWrap::SyntheticModuleEvaluationStepsCallback( diff --git a/src/module_wrap.h b/src/module_wrap.h -index e17048357feca2419087621ed280de30882a90bc..061117dc3182d63e35d7e99ffd95801f96356322 100644 +index e17048357feca2419087621ed280de30882a90bc..63682be31ce00a3bf7b9be909cac4b7f9ec02a8e 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h -@@ -31,7 +31,14 @@ enum HostDefinedOptions : int { +@@ -7,6 +7,7 @@ + #include + #include + #include "base_object.h" ++#include "node.h" + + namespace node { + +@@ -31,7 +32,14 @@ enum HostDefinedOptions : int { kLength = 9, }; @@ -106,7 +114,7 @@ index e17048357feca2419087621ed280de30882a90bc..061117dc3182d63e35d7e99ffd95801f public: enum InternalFields { kModuleSlot = BaseObject::kInternalFieldCount, -@@ -68,6 +75,8 @@ class ModuleWrap : public BaseObject { +@@ -68,6 +76,8 @@ class ModuleWrap : public BaseObject { return true; } @@ -115,7 +123,7 @@ index e17048357feca2419087621ed280de30882a90bc..061117dc3182d63e35d7e99ffd95801f private: ModuleWrap(Realm* realm, v8::Local object, -@@ -102,7 +111,6 @@ class ModuleWrap : public BaseObject { +@@ -102,7 +112,6 @@ class ModuleWrap : public BaseObject { v8::Local specifier, v8::Local import_attributes, v8::Local referrer); diff --git a/patches/node/fix_missing_include_for_node_extern.patch b/patches/node/fix_missing_include_for_node_extern.patch deleted file mode 100644 index 3e727b102bfe..000000000000 --- a/patches/node/fix_missing_include_for_node_extern.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Wed, 15 Nov 2023 12:25:39 +0100 -Subject: fix: missing include for NODE_EXTERN - -At some point it seems that node.h was removed from the include chain, -causing the following error: - -../../third_party/electron_node/src/module_wrap.h:33:1: error: unknown type name 'NODE_EXTERN' - 33 | NODE_EXTERN v8::MaybeLocal ImportModuleDynamically( - | ^ - -This should be upstreamed. - -diff --git a/src/module_wrap.h b/src/module_wrap.h -index 061117dc3182d63e35d7e99ffd95801f96356322..63682be31ce00a3bf7b9be909cac4b7f9ec02a8e 100644 ---- a/src/module_wrap.h -+++ b/src/module_wrap.h -@@ -7,6 +7,7 @@ - #include - #include - #include "base_object.h" -+#include "node.h" - - namespace node { -