From ba929b4195e6943dceed95366edb17c76696be19 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 6 May 2020 22:47:58 -0700 Subject: [PATCH] chore: remove obsolete cjs assert patch (#23422) --- patches/node/.patches | 1 - .../avoid_calling_deprecated_method.patch | 4 +-- ...ix_we_need_to_eager-load_cjs_modules.patch | 36 ------------------- ...is_deprecated_use_compiledwasmmodule.patch | 2 +- ...sk_api_override_removed_in_latest_v8.patch | 2 +- ...ve_deprecated_wasm_module_type_check.patch | 2 ++ ..._deserialization_of_wasmmoduleobject.patch | 2 ++ ...group_to_finalizationregistry_for_js.patch | 2 ++ ...out_finalizationregistry_cleanupsome.patch | 2 ++ 9 files changed, 12 insertions(+), 41 deletions(-) delete mode 100644 patches/node/fix_we_need_to_eager-load_cjs_modules.patch diff --git a/patches/node/.patches b/patches/node/.patches index 923836b3ba92..2bb0178f0b6d 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -30,7 +30,6 @@ remove_deprecated_task_api_override_removed_in_latest_v8.patch remove_serialization_deserialization_of_wasmmoduleobject.patch override_existing_v8_reallocate.patch fix_use_crypto_impls_for_compat.patch -fix_we_need_to_eager-load_cjs_modules.patch avoid_calling_deprecated_method.patch remove_deprecated_wasm_module_type_check.patch weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch diff --git a/patches/node/avoid_calling_deprecated_method.patch b/patches/node/avoid_calling_deprecated_method.patch index 79dc61491b2d..680bac6f2db7 100644 --- a/patches/node/avoid_calling_deprecated_method.patch +++ b/patches/node/avoid_calling_deprecated_method.patch @@ -5,8 +5,8 @@ Subject: Avoid calling deprecated method The {SetExpectInlineWasm} method is deprecated and non-functional since V8 v8.1. -Thus node should stop calling it, so that it can be fully removed in a -future v8 version. + +This is already present in Node.js v14 and can be removed when we upgrade. diff --git a/src/node_serdes.cc b/src/node_serdes.cc index a2d185c4167a75e227cd4b2abbf5c5abc7e16acb..e918ed9d12e9fb1d13b2fc05a98cab099fb71a68 100644 diff --git a/patches/node/fix_we_need_to_eager-load_cjs_modules.patch b/patches/node/fix_we_need_to_eager-load_cjs_modules.patch deleted file mode 100644 index 8d6bc1c2e5a3..000000000000 --- a/patches/node/fix_we_need_to_eager-load_cjs_modules.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Thu, 20 Feb 2020 19:04:18 -0800 -Subject: fix: we need to eager-load cjs modules - -Node.js added a check to prevent commonjs modules being loaded before prepareMainThreadExecution, -but Electron needs to do that in our asar logic in order to override child_process. I plan to -either tweak this logic and upstream it to Nodejs, or to find an alternate approach in Electron -for overriding the child_process apis. - -diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js -index 35ad9ee1a685177894bb5c13c58c16af2ccee362..865ade2b6917321e16ef3b5f12121e8bfcc25b07 100644 ---- a/lib/internal/bootstrap/pre_execution.js -+++ b/lib/internal/bootstrap/pre_execution.js -@@ -64,7 +64,7 @@ function prepareMainThreadExecution(expandArgv1 = false) { - initializeESMLoader(); - - const CJSLoader = require('internal/modules/cjs/loader'); -- assert(!CJSLoader.hasLoadedAnyUserCJSModule); -+ // assert(!CJSLoader.hasLoadedAnyUserCJSModule); - loadPreloadModules(); - initializeFrozenIntrinsics(); - setupAsarSupport(); -diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js -index 56ccd9df5e9b539297856a31691f577a5ab56bf0..abc1efcef3822c84f5f70ed64e1e9a80a16be98c 100644 ---- a/lib/internal/main/worker_thread.js -+++ b/lib/internal/main/worker_thread.js -@@ -115,7 +115,7 @@ port.on('message', (message) => { - initializeESMLoader(); - - const CJSLoader = require('internal/modules/cjs/loader'); -- assert(!CJSLoader.hasLoadedAnyUserCJSModule); -+ // assert(!CJSLoader.hasLoadedAnyUserCJSModule); - loadPreloadModules(); - initializeFrozenIntrinsics(); - if (argv !== undefined) { diff --git a/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch b/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch index 7a8fafb028a0..4bf8fd7483d0 100644 --- a/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch +++ b/patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch @@ -4,7 +4,7 @@ Date: Mon, 2 Dec 2019 17:25:38 -0800 Subject: refactor: TransferrableModule is deprecated, use CompiledWasmModule instead -This will be upstreamed to nodejs/node +This is already present in Node.js v14 and can be removed when we upgrade. diff --git a/src/node_messaging.cc b/src/node_messaging.cc index c7c46063731a5b49366d8e8702b625162b361471..a8cfbec2f5bf2387312237114ab5eb058561b898 100644 diff --git a/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch b/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch index 14b55c9dee9f..ba852b9da83c 100644 --- a/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch +++ b/patches/node/remove_deprecated_task_api_override_removed_in_latest_v8.patch @@ -3,7 +3,7 @@ From: Andy Locascio Date: Thu, 9 Jan 2020 15:48:36 -0800 Subject: remove deprecated task API override removed in latest v8 -Node.js will pick this up when they roll next. +This is already present in Node.js v14 and can be removed when we upgrade. CL: https://chromium-review.googlesource.com/c/v8/v8/+/1868620 diff --git a/patches/node/remove_deprecated_wasm_module_type_check.patch b/patches/node/remove_deprecated_wasm_module_type_check.patch index d3093d7407e5..940cf1a78f37 100644 --- a/patches/node/remove_deprecated_wasm_module_type_check.patch +++ b/patches/node/remove_deprecated_wasm_module_type_check.patch @@ -6,6 +6,8 @@ Subject: Remove deprecated wasm module type check The method was deprecated in favor of {IsWasmModuleObject}. https://chromium-review.googlesource.com/c/v8/v8/+/2033170 +This is already present in Node.js v14 and can be removed when we upgrade. + diff --git a/src/node_types.cc b/src/node_types.cc index a53bcba555448fd99d582da7dc0c7af528627ca5..e816e0af54d1cf52f2af9ded49e25625b782d5be 100644 --- a/src/node_types.cc diff --git a/patches/node/remove_serialization_deserialization_of_wasmmoduleobject.patch b/patches/node/remove_serialization_deserialization_of_wasmmoduleobject.patch index 9c993a7aa1f5..0bb4193f054a 100644 --- a/patches/node/remove_serialization_deserialization_of_wasmmoduleobject.patch +++ b/patches/node/remove_serialization_deserialization_of_wasmmoduleobject.patch @@ -3,6 +3,8 @@ From: John Kleinschmidt Date: Tue, 28 Jan 2020 12:12:28 -0500 Subject: Remove serialization/deserialization of WasmModuleObject +This is already present in Node.js v14 and can be removed when we upgrade. + Serialization of WasmModuleObject was removed here: https://chromium.googlesource.com/v8/v8/+/30e4ba6df4cdf5582de4d79850bcd270e6a75a7a diff --git a/patches/node/weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch b/patches/node/weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch index 76ebae0216d9..9480c321d668 100644 --- a/patches/node/weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch +++ b/patches/node/weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch @@ -5,6 +5,8 @@ Subject: Rename FinalizationGroup to FinalizationRegistry for JS https://chromium-review.googlesource.com/c/v8/v8/+/2071236 +This is already present in Node.js v14 and can be removed when we upgrade. + diff --git a/test/parallel/test-finalization-group-error.js b/test/parallel/test-finalization-group-error.js index 0685811f55b7f8efc88e04ffd5e173ed7d415258..46a670073b1dbba9729e54166378991a7edba5a0 100644 --- a/test/parallel/test-finalization-group-error.js diff --git a/patches/node/weakrefs_split_out_finalizationregistry_cleanupsome.patch b/patches/node/weakrefs_split_out_finalizationregistry_cleanupsome.patch index 6ad1a0a11bb3..e2325fe44f58 100644 --- a/patches/node/weakrefs_split_out_finalizationregistry_cleanupsome.patch +++ b/patches/node/weakrefs_split_out_finalizationregistry_cleanupsome.patch @@ -5,6 +5,8 @@ Subject: Split out FinalizationRegistry#cleanupSome to a different flag https://chromium-review.googlesource.com/c/v8/v8/+/2141011 +This is already present in Node.js v14 and can be removed when we upgrade. + diff --git a/test/parallel/test-finalization-group-error.js b/test/parallel/test-finalization-group-error.js index 46a670073b1dbba9729e54166378991a7edba5a0..0857bedd043f0436bddc6d8641c51e78a8b4c562 100644 --- a/test/parallel/test-finalization-group-error.js