Browse Source

chore: bump node to v12.18.3 (master) (#24707)

Co-authored-by: Shelley Vohr <[email protected]>
Electron Bot 4 years ago
parent
commit
2f02a469f4
26 changed files with 120 additions and 203 deletions
  1. 1 1
      DEPS
  2. 6 5
      lib/asar/fs-wrapper.ts
  3. 0 2
      patches/node/.patches
  4. 6 5
      patches/node/build_add_gn_build_files.patch
  5. 4 4
      patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
  6. 6 6
      patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
  7. 9 9
      patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch
  8. 2 2
      patches/node/expose_get_builtin_module_function.patch
  9. 4 4
      patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch
  10. 2 2
      patches/node/fix_allow_preventing_setpromiserejectcallback.patch
  11. 3 3
      patches/node/fix_build_and_expose_inspector_agent.patch
  12. 9 9
      patches/node/fix_comment_out_incompatible_crypto_modules.patch
  13. 2 2
      patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
  14. 3 3
      patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch
  15. 0 19
      patches/node/fix_remove_bad_semicolon_outside_fn.patch
  16. 2 2
      patches/node/fix_use_crypto_impls_for_compat.patch
  17. 1 1
      patches/node/fixme_remove_async_id_assertion_check.patch
  18. 2 2
      patches/node/fixme_use_redefined_version_of_internalmodulestat.patch
  19. 9 9
      patches/node/lib_src_switch_buffer_kmaxlength_to_size_t.patch
  20. 2 2
      patches/node/make_module_globalpaths_a_reference.patch
  21. 3 3
      patches/node/pass_all_globals_through_require.patch
  22. 26 16
      patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch
  23. 6 6
      patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
  24. 2 2
      patches/node/revert_crypto_add_oaeplabel_option.patch
  25. 0 79
      patches/node/test_account_for_non-node_basename.patch
  26. 10 5
      spec/asar-spec.js

+ 1 - 1
DEPS

@@ -16,7 +16,7 @@ vars = {
   'chromium_version':
     '93a6ebbe22f1a093e6a0cb5e72ba78990fe39824',
   'node_version':
-    'v12.18.2',
+    'v12.18.3',
   'nan_version':
     '2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
   'squirrel.mac_version':

+ 6 - 5
lib/asar/fs-wrapper.ts

@@ -675,11 +675,11 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
     const { asarPath, filePath } = pathInfo;
 
     const archive = getOrCreateArchive(asarPath);
-    if (!archive) return;
+    if (!archive) return [];
 
     const info = archive.getFileInfo(filePath);
-    if (!info) return;
-    if (info.size === 0) return '';
+    if (!info) return [];
+    if (info.size === 0) return ['', false];
     if (info.unpacked) {
       const realPath = archive.copyFileOut(filePath);
       return fs.readFileSync(realPath, { encoding: 'utf8' });
@@ -687,11 +687,12 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
 
     const buffer = Buffer.alloc(info.size);
     const fd = archive.getFd();
-    if (!(fd >= 0)) return;
+    if (!(fd >= 0)) return [];
 
     logASARAccess(asarPath, filePath, info.offset);
     fs.readSync(fd, buffer, 0, info.size, info.offset);
-    return buffer.toString('utf8');
+    const str = buffer.toString('utf8');
+    return [str, str.length > 0];
   };
 
   const { internalModuleStat } = internalBinding('fs');

+ 0 - 2
patches/node/.patches

@@ -35,9 +35,7 @@ weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch
 weakrefs_split_out_finalizationregistry_cleanupsome.patch
 fix_window_c-ares_incompatibilities.patch
 chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch
-fix_remove_bad_semicolon_outside_fn.patch
 fix_comment_out_incompatible_crypto_modules.patch
-test_account_for_non-node_basename.patch
 lib_src_switch_buffer_kmaxlength_to_size_t.patch
 update_tests_after_increasing_typed_array_size.patch
 darwin_work_around_clock_jumping_back_in_time.patch

+ 6 - 5
patches/node/build_add_gn_build_files.patch

@@ -866,10 +866,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
 +}
 diff --git a/filenames.json b/filenames.json
 new file mode 100644
-index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612afdc6d9e1a
+index 0000000000000000000000000000000000000000..964255d66b8c77ccd919853c8fceb53789756255
 --- /dev/null
 +++ b/filenames.json
-@@ -0,0 +1,518 @@
+@@ -0,0 +1,519 @@
 +// This file is automatically generated by generate_gn_filenames_json.py
 +// DO NOT EDIT
 +{
@@ -926,6 +926,7 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
 +    {
 +      "dest_dir": "include/node//",
 +      "files": [
++        "//v8/include/v8-cppgc.h",
 +        "//v8/include/v8-fast-api-calls.h",
 +        "//v8/include/v8-internal.h",
 +        "//v8/include/v8-platform.h",
@@ -1105,6 +1106,7 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
 +    "lib/internal/main/run_third_party_main.js",
 +    "lib/internal/main/worker_thread.js",
 +    "lib/internal/modules/run_main.js",
++    "lib/internal/modules/package_json_reader.js",
 +    "lib/internal/modules/cjs/helpers.js",
 +    "lib/internal/modules/cjs/loader.js",
 +    "lib/internal/modules/esm/loader.js",
@@ -1231,7 +1233,6 @@ index 0000000000000000000000000000000000000000..94816008fb2aeb4c8453f87ca8d612af
 +    "src/node_contextify.cc",
 +    "src/node_credentials.cc",
 +    "src/node_dir.cc",
-+    "src/node_domain.cc",
 +    "src/node_env_var.cc",
 +    "src/node_errors.cc",
 +    "src/node_file.cc",
@@ -1594,7 +1595,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
 +  args = rebase_path(inputs + outputs, root_build_dir)
 +}
 diff --git a/src/node_version.h b/src/node_version.h
-index a43e451ab0cd5f2bc24453d5821deb380d2ab6d0..190479619f188bd05d1faac4696670fe18425a53 100644
+index 9252d51555f0e1bf0957bc4f8bc6e399c1ac6c23..431dd57a7dddc7476a179a5f30ce9e66814006ec 100644
 --- a/src/node_version.h
 +++ b/src/node_version.h
 @@ -89,7 +89,10 @@
@@ -1750,7 +1751,7 @@ index 655802980a6ea94d1d4ca1dc63c8c8e905fbb83a..ab1a18a215cb7393310324c6dbcacc66
    if 'false' == variables.get('node_shared_libuv'):
      subdir_files('deps/uv/include', 'include/node/', action)
 diff --git a/tools/js2c.py b/tools/js2c.py
-index 4594694a2cab0d878d86127a72714ed60c251b6e..9e9883129bed62c591d23f71d139514c5034ac8d 100755
+index 195e6a6189a98916bcfb7abb1b73595b8bc8eb38..d5109fcae5542730623f5ec3ca244ec0973109f2 100755
 --- a/tools/js2c.py
 +++ b/tools/js2c.py
 @@ -130,6 +130,14 @@ def NormalizeFileName(filename):

+ 4 - 4
patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

@@ -14,10 +14,10 @@ renderer/browser/worker/sandboxed bootstrap scripts).  These are loaded
 through LoadEmbedderJavaScriptSource()
 
 diff --git a/src/node_native_module.cc b/src/node_native_module.cc
-index 1b916d645d863929710ce5e4e930ec72fb426844..6d39a8858e093199fb935b68ff84388d48d6c35e 100644
+index 7362207412efa49bddfab4e32a64c7e07cf29074..acd9afa62d3aa1b01ce54f189a7261e7e61aa60d 100644
 --- a/src/node_native_module.cc
 +++ b/src/node_native_module.cc
-@@ -23,6 +23,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
+@@ -20,6 +20,7 @@ NativeModuleLoader NativeModuleLoader::instance_;
  
  NativeModuleLoader::NativeModuleLoader() : config_(GetConfig()) {
    LoadJavaScriptSource();
@@ -38,7 +38,7 @@ index c0bce3bce42c848d63a10147ef483c9d4465f5ce..7f296e459d46b4cda51baf9887df060f
  
    bool Exists(const char* id);
 diff --git a/tools/js2c.py b/tools/js2c.py
-index 9e9883129bed62c591d23f71d139514c5034ac8d..ad073bd7f023c8436985f177011a7d29829098b4 100755
+index d5109fcae5542730623f5ec3ca244ec0973109f2..8537f7fd50b0441307f91cad3bf9f730c2cb8cdf 100755
 --- a/tools/js2c.py
 +++ b/tools/js2c.py
 @@ -56,13 +56,15 @@ namespace native_module {{
@@ -118,7 +118,7 @@ index 9e9883129bed62c591d23f71d139514c5034ac8d..ad073bd7f023c8436985f177011a7d29
    write_if_chaged(out, target)
  
  
-@@ -208,17 +223,21 @@ def main():
+@@ -209,17 +224,21 @@ def main():
    )
    parser.add_argument('--target', help='output file')
    parser.add_argument('--verbose', action='store_true', help='output file')

+ 6 - 6
patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch

@@ -23,10 +23,10 @@ index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052
  
    // TODO(joyeecheung): most of these should be deprecated and removed,
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19e11526c3 100644
+index 7d08fb05e9a0abeb82d416891968b23002dc3685..1f6f5e0cee36fb2a07963264f513a930c349b8fa 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1109,6 +1109,13 @@ Module.prototype._compile = function(content, filename) {
+@@ -1111,6 +1111,13 @@ Module.prototype._compile = function(content, filename) {
    if (getOptionValue('--inspect-brk') && process._eval == null) {
      if (!resolvedArgv) {
        // We enter the repl if we're not given a filename argument.
@@ -41,7 +41,7 @@ index e478c57af873da717c00db73d6719f806280efe1..1c949cab49224a6f1be7685acfd3ed19
          try {
            resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
 diff --git a/src/env.h b/src/env.h
-index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a 100644
+index d22b579b25ce4e6af8ec042e282e94248ea14162..67cefbe35f390ba25b49e422d10bca8b423a49a8 100644
 --- a/src/env.h
 +++ b/src/env.h
 @@ -890,6 +890,15 @@ class Environment : public MemoryRetainer {
@@ -60,7 +60,7 @@ index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b93
    void InitializeLibuv(bool start_profiler_idle_notifier);
    inline const std::vector<std::string>& exec_argv();
    inline const std::vector<std::string>& argv();
-@@ -1273,6 +1282,9 @@ class Environment : public MemoryRetainer {
+@@ -1271,6 +1280,9 @@ class Environment : public MemoryRetainer {
    inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
                           const char* errmsg);
  
@@ -71,7 +71,7 @@ index 6de5ba9b192dd1ec23afe7a7736373acb59a6c4e..b6e02a2910cd8fe5ff3a17d6e1a98b93
    v8::Isolate* const isolate_;
    IsolateData* const isolate_data_;
 diff --git a/src/node_binding.cc b/src/node_binding.cc
-index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca2179b4a0 100644
+index 5291858bb164a262ca1d69d2582e037aeab23d55..a9ce41fbba4e8b0c4704c1d7795308ce18916739 100644
 --- a/src/node_binding.cc
 +++ b/src/node_binding.cc
 @@ -3,6 +3,7 @@
@@ -82,7 +82,7 @@ index 565a3fff85a25ef25ccf5c74d2ade7f5a6994b05..814f01f6144c0a0e053d2100f88e29ca
  #include "util.h"
  
  #if HAVE_OPENSSL
-@@ -462,10 +463,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
+@@ -461,10 +462,22 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
  
      if (mp != nullptr) {
        if (mp->nm_context_register_func == nullptr) {

+ 9 - 9
patches/node/chore_sethostcleanupfinalizationgroupcallback_has_been_removed_from.patch

@@ -5,7 +5,7 @@ Subject: chore: SetHostCleanupFinalizationGroupCallback has been removed from
  V8
 
 diff --git a/src/api/environment.cc b/src/api/environment.cc
-index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea463070456c77 100644
+index e2aa9c821de685a022fd78935399b7d219468403..2bfba8a011c2b902932e6b1714bbb55b945cd96d 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
 @@ -12,7 +12,6 @@ using errors::TryCatchScope;
@@ -16,7 +16,7 @@ index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea4630
  using v8::Function;
  using v8::FunctionCallbackInfo;
  using v8::HandleScope;
-@@ -78,15 +77,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
+@@ -72,15 +71,6 @@ static MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
    return result;
  }
  
@@ -32,7 +32,7 @@ index 60d30b7eff7329c4235024c31525107216d70d7a..21980987644c6e83029157785dea4630
  void* NodeArrayBufferAllocator::Allocate(size_t size) {
    void* ret;
    if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers)
-@@ -255,11 +245,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
+@@ -249,11 +239,6 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
      s.promise_reject_callback : task_queue::PromiseRejectCallback;
    isolate->SetPromiseRejectCallback(promise_reject_cb);
  
@@ -62,7 +62,7 @@ index c6ef9dc13ab6f1d1a778871a62a0a98a01d84ec6..222555831aa1bf0b7b29b4b46e235c98
      const CleanupHookCallback& cb) const {
    return std::hash<void*>()(cb.arg_);
 diff --git a/src/env.cc b/src/env.cc
-index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66731d9dde 100644
+index 18788e4ceaf208c13704c9c43f017bb1b6dfb0b6..ee76d5889e5672716ac2f0c586f1ddc47fa56be7 100644
 --- a/src/env.cc
 +++ b/src/env.cc
 @@ -30,7 +30,6 @@ using v8::ArrayBuffer;
@@ -73,7 +73,7 @@ index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66
  using v8::Function;
  using v8::FunctionTemplate;
  using v8::HandleScope;
-@@ -494,7 +493,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
+@@ -487,7 +486,6 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) {
        [](uv_async_t* async) {
          Environment* env = ContainerOf(
              &Environment::task_queues_async_, async);
@@ -81,7 +81,7 @@ index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66
          env->RunAndClearNativeImmediates();
        });
    uv_unref(reinterpret_cast<uv_handle_t*>(&idle_prepare_handle_));
-@@ -1121,25 +1119,6 @@ void Environment::RunWeakRefCleanup() {
+@@ -1085,25 +1083,6 @@ void Environment::RunWeakRefCleanup() {
    isolate()->ClearKeptObjects();
  }
  
@@ -108,10 +108,10 @@ index 657d711e539d81bfd03166bbaaae7f0b5db91a5f..02c5ba259c94bb160972005998007d66
  void BaseObject::DeleteMe(void* data) {
    BaseObject* self = static_cast<BaseObject*>(data);
 diff --git a/src/env.h b/src/env.h
-index b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a..c1966a9f55126bdd65d8c9d529d934977bb4ad65 100644
+index 67cefbe35f390ba25b49e422d10bca8b423a49a8..9420bdf3f71e2df1011ddd7e583071f5c99beac8 100644
 --- a/src/env.h
 +++ b/src/env.h
-@@ -1132,9 +1132,7 @@ class Environment : public MemoryRetainer {
+@@ -1130,9 +1130,7 @@ class Environment : public MemoryRetainer {
    void AtExit(void (*cb)(void* arg), void* arg);
    void RunAtExitCallbacks();
  
@@ -121,7 +121,7 @@ index b6e02a2910cd8fe5ff3a17d6e1a98b937323ae3a..c1966a9f55126bdd65d8c9d529d93497
  
    // Strings and private symbols are shared across shared contexts
    // The getters simply proxy to the per-isolate primitive.
-@@ -1357,8 +1355,6 @@ class Environment : public MemoryRetainer {
+@@ -1355,8 +1353,6 @@ class Environment : public MemoryRetainer {
    uint64_t thread_id_;
    std::unordered_set<worker::Worker*> sub_worker_contexts_;
  

+ 2 - 2
patches/node/expose_get_builtin_module_function.patch

@@ -9,10 +9,10 @@ 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 91ae3530d09b162c910eef4199d89c33c9feb379..565a3fff85a25ef25ccf5c74d2ade7f5a6994b05 100644
+index 0b5f6cfa038369be758e3b0857ee6fa594358b58..5291858bb164a262ca1d69d2582e037aeab23d55 100644
 --- a/src/node_binding.cc
 +++ b/src/node_binding.cc
-@@ -606,6 +606,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
+@@ -605,6 +605,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
    args.GetReturnValue().Set(exports);
  }
  

+ 4 - 4
patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch

@@ -24,7 +24,7 @@ Environment on the V8 context of blink, so no new V8 context is created.
 As a result, a renderer process may have multiple Node Environments in it.
 
 diff --git a/src/node.cc b/src/node.cc
-index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a4928f36b 100644
+index 728785d5d2773df68a891a4c81e7b0ebfa6021bb..15abe45edb39597d4fcc686cca4d79314090fa6f 100644
 --- a/src/node.cc
 +++ b/src/node.cc
 @@ -122,6 +122,8 @@ using v8::Undefined;
@@ -36,7 +36,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a
  namespace per_process {
  
  // node_revert.h
-@@ -733,7 +735,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -736,7 +738,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    binding::RegisterBuiltinModules();
  
    // Make inherited handles noninheritable.
@@ -47,7 +47,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a
  
    // Cache the original command line to be
    // used in diagnostic reports.
-@@ -767,6 +771,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -770,6 +774,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
      if (exit_code != 0) return exit_code;
    }
  #endif
@@ -56,7 +56,7 @@ index 4ff7824b0011685289716d61b02427c3e264965d..f2b0b1585a14eaf6ffdb69a28888b42a
  
    const int exit_code = ProcessGlobalArgs(argv,
                                            exec_argv,
-@@ -811,6 +817,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -814,6 +820,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    }
    per_process::metadata.versions.InitializeIntlVersions();
  #endif

+ 2 - 2
patches/node/fix_allow_preventing_setpromiserejectcallback.patch

@@ -9,10 +9,10 @@ We need to use the one Blink already provides, and so we need to
 slightly augment IsolateSettings to allow for that.
 
 diff --git a/src/api/environment.cc b/src/api/environment.cc
-index 21980987644c6e83029157785dea463070456c77..20d9f91dcf6b5def05a706cf3389d64e9edbcf3e 100644
+index 2bfba8a011c2b902932e6b1714bbb55b945cd96d..28851b8a8f8bdd6dec0f54c62f79fd75a3be08ed 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
-@@ -241,9 +241,11 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
+@@ -235,9 +235,11 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
      s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback;
    isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb);
  

+ 3 - 3
patches/node/fix_build_and_expose_inspector_agent.patch

@@ -6,10 +6,10 @@ Subject: fix: build and expose inspector agent
 Node inspector initialization happens in a different start-up function in node.cc, which we don't call in Electron. This allows for us to use the inspector agent in electron/atom/browser/node_debugger.cc
 
 diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
-index 94433b75d0fdb2ef902e20a60288995fcbf2bbac..3e865357f409470f15ed29a3f87b717812637c37 100644
+index 7712a62d7cbeb0975f00877be36b55da150f1459..1e990059198de3fedc912bfbd5eb6eae8e5c3eea 100644
 --- a/src/inspector_agent.cc
 +++ b/src/inspector_agent.cc
-@@ -222,7 +222,7 @@ const int CONTEXT_GROUP_ID = 1;
+@@ -220,7 +220,7 @@ const int CONTEXT_GROUP_ID = 1;
  
  std::string GetWorkerLabel(node::Environment* env) {
    std::ostringstream result;
@@ -18,7 +18,7 @@ index 94433b75d0fdb2ef902e20a60288995fcbf2bbac..3e865357f409470f15ed29a3f87b7178
    return result.str();
  }
  
-@@ -470,7 +470,7 @@ class NodeInspectorClient : public V8InspectorClient {
+@@ -468,7 +468,7 @@ class NodeInspectorClient : public V8InspectorClient {
      client_ = V8Inspector::create(env->isolate(), this);
      // TODO(bnoordhuis) Make name configurable from src/node.cc.
      std::string name =

+ 9 - 9
patches/node/fix_comment_out_incompatible_crypto_modules.patch

@@ -9,10 +9,10 @@ with what's exposed through BoringSSL. I plan to upstream parts of this or
 otherwise introduce shims to reduce friction.
 
 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
-index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20b1b58bb0 100644
+index c373533ce85241f86d64eab8a49af79f935acdeb..454fff5ada0c271db7fb975f809c84d87773dcd6 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -5142,6 +5142,7 @@ bool DiffieHellman::Init(int primeLength, int g) {
+@@ -5145,6 +5145,7 @@ bool DiffieHellman::Init(int primeLength, int g) {
  
  bool DiffieHellman::Init(const char* p, int p_len, int g) {
    dh_.reset(DH_new());
@@ -20,7 +20,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
    if (p_len <= 0) {
      BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
      return false;
-@@ -5150,6 +5151,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
+@@ -5153,6 +5154,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
      DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
      return false;
    }
@@ -28,7 +28,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
    BIGNUM* bn_p =
        BN_bin2bn(reinterpret_cast<const unsigned char*>(p), p_len, nullptr);
    BIGNUM* bn_g = BN_new();
-@@ -5165,6 +5167,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
+@@ -5168,6 +5170,7 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
  
  bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
    dh_.reset(DH_new());
@@ -36,7 +36,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
    if (p_len <= 0) {
      BNerr(BN_F_BN_GENERATE_PRIME_EX, BN_R_BITS_TOO_SMALL);
      return false;
-@@ -5187,6 +5190,7 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
+@@ -5190,6 +5193,7 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
      BN_free(bn_g);
      return false;
    }
@@ -44,7 +44,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
    return VerifyContext();
  }
  
-@@ -6154,6 +6158,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6157,6 +6161,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
    EVPKeyCtxPointer Setup() override {
      EVPKeyPointer params;
      if (prime_info_.fixed_value_) {
@@ -52,7 +52,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
        DHPointer dh(DH_new());
        if (!dh)
          return nullptr;
-@@ -6170,6 +6175,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6173,6 +6178,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
        params = EVPKeyPointer(EVP_PKEY_new());
        CHECK(params);
        EVP_PKEY_assign_DH(params.get(), dh.release());
@@ -60,7 +60,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
      } else {
        EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr));
        if (!param_ctx)
-@@ -6177,7 +6183,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6180,7 +6186,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
  
        if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
          return nullptr;
@@ -69,7 +69,7 @@ index cd763fd3755357b36e753cf778550cf2d498ed57..dad343e15d0f76bdef9d9cc4e78c7e20
        if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(param_ctx.get(),
                                                   prime_info_.prime_size_) <= 0)
          return nullptr;
-@@ -6185,7 +6191,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6188,7 +6194,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
        if (EVP_PKEY_CTX_set_dh_paramgen_generator(param_ctx.get(),
                                                   generator_) <= 0)
          return nullptr;

+ 2 - 2
patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch

@@ -5,10 +5,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
  of v8::TracingController
 
 diff --git a/src/api/environment.cc b/src/api/environment.cc
-index 09d71b34581268bfe17c3182029cb3949d857d48..60d30b7eff7329c4235024c31525107216d70d7a 100644
+index 5526859e551c10b31e9999d1f8ba89a94db9abfc..e2aa9c821de685a022fd78935399b7d219468403 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
-@@ -358,6 +358,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
+@@ -352,6 +352,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
    return per_process::v8_platform.Platform();
  }
  

+ 3 - 3
patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch

@@ -6,7 +6,7 @@ Subject: fix: key gen APIs are not available in BoringSSL
 This will make Node's key pair generation APIs fail.
 
 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
-index f08d68d6b6e6303485e2c53aebc0d42708bd022a..17aeb99d586161d0af69376811b42e84a80553e3 100644
+index c132e6a089b3cb7119910131fe740574d7917b89..82afaee6e2b929faac76fc5d930a8c0fd6558df3 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
 @@ -267,24 +267,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
@@ -34,7 +34,7 @@ index f08d68d6b6e6303485e2c53aebc0d42708bd022a..17aeb99d586161d0af69376811b42e84
      V(USER)                                                                   \
  
  #define V(name) case ERR_LIB_##name: lib = #name "_"; break;
-@@ -6082,6 +6072,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6085,6 +6075,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
      if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
        return nullptr;
  
@@ -42,7 +42,7 @@ index f08d68d6b6e6303485e2c53aebc0d42708bd022a..17aeb99d586161d0af69376811b42e84
      if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
        return nullptr;
  
-@@ -6092,6 +6083,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6095,6 +6086,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
          return nullptr;
        }
      }

+ 0 - 19
patches/node/fix_remove_bad_semicolon_outside_fn.patch

@@ -1,19 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Wed, 27 May 2020 12:57:43 -0700
-Subject: fix: remove bad semicolon outside fn
-
-Node.js introduced a bad semicolon style in
-https://github.com/nodejs/node/pull/29207. Upstreamed in
-https://github.com/nodejs/node/pull/33592.
-
-diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc
-index 107a25bc977bd38e97a2310b272e495d09847ecb..3ed390678962890d90d385cf2bca9deaca023c89 100644
---- a/src/node_watchdog.cc
-+++ b/src/node_watchdog.cc
-@@ -432,4 +432,4 @@ static void Initialize(Local<Object> target,
- 
- }  // namespace node
- 
--NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize);
-+NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize)

+ 2 - 2
patches/node/fix_use_crypto_impls_for_compat.patch

@@ -8,10 +8,10 @@ by using the implementations of those functions as found in the OpenSSL repo.
 I plan to try and upstream a version of this.
 
 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
-index 14029692e57b219d245d529a0be175c80f3a32de..cd763fd3755357b36e753cf778550cf2d498ed57 100644
+index ce64dbca7ce6555bd37d3b6f85ecf41a98e3dd29..c373533ce85241f86d64eab8a49af79f935acdeb 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -4522,7 +4522,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
+@@ -4525,7 +4525,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
    if (base_id == EVP_PKEY_DSA) {
      DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get());
      // Both r and s are computed mod q, so their width is limited by that of q.

+ 1 - 1
patches/node/fixme_remove_async_id_assertion_check.patch

@@ -7,7 +7,7 @@ async hooks are hella broken in Electron. This was checking that they weren't,
 but they are, so we just disabled the check. YOLO.
 
 diff --git a/src/api/callback.cc b/src/api/callback.cc
-index a03a2587b4c7963a7f356b6b3af8654405bcfd36..cd0050978d387c2d2228653a8e812a31a1145819 100644
+index 9f52c25cf0d9005c2e70b76eb52eae1bd15f0a53..e151871dc90b6c29dc3fc3db162e24baeb45923d 100644
 --- a/src/api/callback.cc
 +++ b/src/api/callback.cc
 @@ -117,12 +117,14 @@ void InternalCallbackScope::Close() {

+ 2 - 2
patches/node/fixme_use_redefined_version_of_internalmodulestat.patch

@@ -9,10 +9,10 @@ this has to be done after the upgrade to the Node.js v8.7.0.  in the very beginn
 to a native Node.js implementation of the function.
 
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index b1f453442bc2a35fabaa6f259091660aedad9a07..92554a374d189b3b284546b0e122940e9a175de8 100644
+index 0ef46569924354ea3ef59f3220637e30b316a761..44271058a26dc05b693e07aad9a22037dd9a5d1f 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -144,6 +144,8 @@ function enrichCJSError(err) {
+@@ -142,6 +142,8 @@ function enrichCJSError(err) {
  }
  
  function stat(filename) {

+ 9 - 9
patches/node/lib_src_switch_buffer_kmaxlength_to_size_t.patch

@@ -26,7 +26,7 @@ Reviewed-By: Tobias Nießen <[email protected]>
 Reviewed-By: Shelley Vohr <[email protected]>
 
 diff --git a/lib/fs.js b/lib/fs.js
-index 4a19e3b6033711d8c77d1ac9ea7e0f2cd9742ce9..59a41fe62c68c05ab09ad280e4e9ecdb2ca23349 100644
+index 9b70b237ef00e19983b39902b50233c682492771..7e1cb0e9e72078340e1f2cc77cd70e7a1f6bf595 100644
 --- a/lib/fs.js
 +++ b/lib/fs.js
 @@ -24,6 +24,10 @@
@@ -40,7 +40,7 @@ index 4a19e3b6033711d8c77d1ac9ea7e0f2cd9742ce9..59a41fe62c68c05ab09ad280e4e9ecdb
  const {
    Map,
    MathMax,
-@@ -52,7 +56,7 @@ const {
+@@ -53,7 +57,7 @@ const {
  const pathModule = require('path');
  const { isArrayBufferView } = require('internal/util/types');
  const binding = internalBinding('fs');
@@ -49,7 +49,7 @@ index 4a19e3b6033711d8c77d1ac9ea7e0f2cd9742ce9..59a41fe62c68c05ab09ad280e4e9ecdb
  const {
    codes: {
      ERR_FS_FILE_TOO_LARGE,
-@@ -274,7 +278,7 @@ function readFileAfterStat(err, stats) {
+@@ -278,7 +282,7 @@ function readFileAfterStat(err, stats) {
  
    const size = context.size = isFileType(stats, S_IFREG) ? stats[8] : 0;
  
@@ -58,7 +58,7 @@ index 4a19e3b6033711d8c77d1ac9ea7e0f2cd9742ce9..59a41fe62c68c05ab09ad280e4e9ecdb
      err = new ERR_FS_FILE_TOO_LARGE(size);
      return context.close(err);
    }
-@@ -331,7 +335,7 @@ function tryCreateBuffer(size, fd, isUserFd) {
+@@ -335,7 +339,7 @@ function tryCreateBuffer(size, fd, isUserFd) {
    let threw = true;
    let buffer;
    try {
@@ -68,10 +68,10 @@ index 4a19e3b6033711d8c77d1ac9ea7e0f2cd9742ce9..59a41fe62c68c05ab09ad280e4e9ecdb
      }
      buffer = Buffer.allocUnsafe(size);
 diff --git a/lib/internal/errors.js b/lib/internal/errors.js
-index 1e987cefb156df8e7a494bcb80547ae8e0ea649f..567d82c7bd12a7233481d80042d331afd7471674 100644
+index a3d99a79c6340c3bc2955bf3b36d11e8676d1aa1..4e2d1e48257acff20131ee998a0774b709d5dbcc 100644
 --- a/lib/internal/errors.js
 +++ b/lib/internal/errors.js
-@@ -822,9 +822,7 @@ E('ERR_FALSY_VALUE_REJECTION', function(reason) {
+@@ -827,9 +827,7 @@ E('ERR_FALSY_VALUE_REJECTION', function(reason) {
    this.reason = reason;
    return 'Promise was rejected with falsy value';
  }, Error);
@@ -83,7 +83,7 @@ index 1e987cefb156df8e7a494bcb80547ae8e0ea649f..567d82c7bd12a7233481d80042d331af
    'Symlink type must be one of "dir", "file", or "junction". Received "%s"',
    Error); // Switch to TypeError. The current implementation does not seem right
 diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js
-index d653724474f314cd1c6bebe0a2d9285439d54928..98335fdc1027409a2f17ae50fba378f5d78b2cab 100644
+index 31eaeef28462166036c5a71a474e1b3c018cfa53..91cf9f6be52d47ba7353ca19f687ab2bb41cbd22 100644
 --- a/lib/internal/fs/promises.js
 +++ b/lib/internal/fs/promises.js
 @@ -1,5 +1,9 @@
@@ -115,7 +115,7 @@ index d653724474f314cd1c6bebe0a2d9285439d54928..98335fdc1027409a2f17ae50fba378f5
  
    const chunks = [];
 diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js
-index 6f096336f20e10727b6328af9f0130b37de74050..ff26568bd95e0c966b7f3a7c63d3f594b411fbab 100644
+index ed4e9bb66ad79ffd542b769ab17a28bb801764c6..84f9e3b806a237c599f85dcb8fb93bfe9a098eda 100644
 --- a/lib/internal/fs/utils.js
 +++ b/lib/internal/fs/utils.js
 @@ -12,7 +12,7 @@ const {
@@ -138,7 +138,7 @@ index 6f096336f20e10727b6328af9f0130b37de74050..ff26568bd95e0c966b7f3a7c63d3f594
  let fs;
  function lazyLoadFs() {
    if (!fs) {
-@@ -525,7 +529,7 @@ const validateOffsetLengthWrite = hideStackFrames(
+@@ -569,7 +573,7 @@ const validateOffsetLengthWrite = hideStackFrames(
        throw new ERR_OUT_OF_RANGE('offset', `<= ${byteLength}`, offset);
      }
  

+ 2 - 2
patches/node/make_module_globalpaths_a_reference.patch

@@ -10,10 +10,10 @@ node's module code.
 (cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
 
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index fc42eb033c923fcdb7eb79e6676a191be6eb1d91..a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d 100644
+index 98668573db651a42876c3369e6fa7c2ef97d6e73..d041ce0470ee48d44897fb77f37f6013d9cc108a 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1255,8 +1255,8 @@ Module._initPaths = function() {
+@@ -1254,8 +1254,8 @@ Module._initPaths = function() {
  
    modulePaths = paths;
  

+ 3 - 3
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 a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d..b1f453442bc2a35fabaa6f259091660aedad9a07 100644
+index d041ce0470ee48d44897fb77f37f6013d9cc108a..0ef46569924354ea3ef59f3220637e30b316a761 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -104,6 +104,13 @@ const {
+@@ -102,6 +102,13 @@ const {
    CHAR_COLON
  } = require('internal/constants');
  
@@ -23,7 +23,7 @@ index a8adb63a2e42929d040f6cdea6f01bd4c2cb1d2d..b1f453442bc2a35fabaa6f259091660a
  const isWindows = process.platform === 'win32';
  
  const relativeResolveCache = ObjectCreate(null);
-@@ -1133,10 +1140,12 @@ Module.prototype._compile = function(content, filename) {
+@@ -1132,10 +1139,12 @@ Module.prototype._compile = function(content, filename) {
    if (requireDepth === 0) statCache = new Map();
    if (inspectorWrapper) {
      result = inspectorWrapper(compiledWrapper, thisValue, exports,

+ 26 - 16
patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch

@@ -22,22 +22,19 @@ index c872941b974216d94863bcbf0e597b9c09ca50e2..4e7c3c10255a0eae4d5333f88e51cf71
  process.config = JSONParse(internalBinding('native_module').config);
  
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index 92554a374d189b3b284546b0e122940e9a175de8..e478c57af873da717c00db73d6719f806280efe1 100644
+index 44271058a26dc05b693e07aad9a22037dd9a5d1f..7d08fb05e9a0abeb82d416891968b23002dc3685 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -55,10 +55,7 @@ const assert = require('internal/assert');
+@@ -55,7 +55,7 @@ const assert = require('internal/assert');
  const fs = require('fs');
  const internalFS = require('internal/fs/utils');
  const path = require('path');
--const {
--  internalModuleReadJSON,
--  internalModuleStat
--} = internalBinding('fs');
+-const { internalModuleStat } = internalBinding('fs');
 +const internalFsBinding = internalBinding('fs');
+ const packageJsonReader = require('internal/modules/package_json_reader');
  const { safeGetenv } = internalBinding('credentials');
  const {
-   makeRequireFunction,
-@@ -144,14 +141,12 @@ function enrichCJSError(err) {
+@@ -142,14 +142,12 @@ function enrichCJSError(err) {
  }
  
  function stat(filename) {
@@ -53,12 +50,25 @@ index 92554a374d189b3b284546b0e122940e9a175de8..e478c57af873da717c00db73d6719f80
    if (statCache !== null) statCache.set(filename, result);
    return result;
  }
-@@ -257,7 +252,7 @@ function readPackage(requestPath) {
-   const existing = packageJsonCache.get(jsonPath);
-   if (existing !== undefined) return existing;
+diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js
+index 066047b55eb9d82bc1eea66dc54aa68abd116b6b..4fcc65e235692d7d5fe2643571f006c593c4e173 100644
+--- a/lib/internal/modules/package_json_reader.js
++++ b/lib/internal/modules/package_json_reader.js
+@@ -1,7 +1,7 @@
+ 'use strict';
  
--  const json = internalModuleReadJSON(path.toNamespacedPath(jsonPath));
-+  const json = internalFsBinding.internalModuleReadJSON(path.toNamespacedPath(jsonPath));
-   if (json === undefined) {
-     packageJsonCache.set(jsonPath, false);
-     return false;
+ const { SafeMap } = primordials;
+-const { internalModuleReadJSON } = internalBinding('fs');
++const internalFsBinding = internalBinding('fs');
+ 
+ const cache = new SafeMap();
+ 
+@@ -14,7 +14,7 @@ function read(path) {
+     return cache.get(path);
+   }
+ 
+-  const [string, containsKeys] = internalModuleReadJSON(path);
++  const [string, containsKeys] = internalFsBinding.internalModuleReadJSON(path);
+   const result = { string, containsKeys };
+   cache.set(path, result);
+   return result;

+ 6 - 6
patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch

@@ -7,10 +7,10 @@ Subject: refactor: TransferrableModule is deprecated, use CompiledWasmModule
 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 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b93ef2969e 100644
+index f19e541bff08fb69209a50f4b21257de77efaf9f..f42ed9661500d862545c09cdb233ca8a99cafd35 100644
 --- a/src/node_messaging.cc
 +++ b/src/node_messaging.cc
-@@ -57,7 +57,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
+@@ -56,7 +56,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
        Environment* env,
        const std::vector<MessagePort*>& message_ports,
        const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers,
@@ -19,7 +19,7 @@ index 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b9
        : message_ports_(message_ports),
          shared_array_buffers_(shared_array_buffers),
          wasm_modules_(wasm_modules) {}
-@@ -81,7 +81,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
+@@ -80,7 +80,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
    MaybeLocal<WasmModuleObject> GetWasmModuleFromId(
        Isolate* isolate, uint32_t transfer_id) override {
      CHECK_LE(transfer_id, wasm_modules_.size());
@@ -28,7 +28,7 @@ index 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b9
          isolate, wasm_modules_[transfer_id]);
    }
  
-@@ -90,7 +90,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
+@@ -89,7 +89,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
   private:
    const std::vector<MessagePort*>& message_ports_;
    const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers_;
@@ -37,7 +37,7 @@ index 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b9
  };
  
  }  // anonymous namespace
-@@ -180,7 +180,7 @@ void Message::AddMessagePort(std::unique_ptr<MessagePortData>&& data) {
+@@ -179,7 +179,7 @@ void Message::AddMessagePort(std::unique_ptr<MessagePortData>&& data) {
    message_ports_.emplace_back(std::move(data));
  }
  
@@ -46,7 +46,7 @@ index 16b1a97eec2dfc236d54e76ef795ce1c0b958fb8..9ed2526fc04f63d857942684dd63b1b9
    wasm_modules_.emplace_back(std::move(mod));
    return wasm_modules_.size() - 1;
  }
-@@ -277,7 +277,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {
+@@ -276,7 +276,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {
  
    Maybe<uint32_t> GetWasmModuleTransferId(
        Isolate* isolate, Local<WasmModuleObject> module) override {

+ 2 - 2
patches/node/revert_crypto_add_oaeplabel_option.patch

@@ -8,10 +8,10 @@ The BoringSSL incompatibilities (OPENSSL_memdup) will be shimmed in and this sho
 be removed when the associated update is rolled into Chromium.
 
 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
-index 17aeb99d586161d0af69376811b42e84a80553e3..14029692e57b219d245d529a0be175c80f3a32de 100644
+index 82afaee6e2b929faac76fc5d930a8c0fd6558df3..ce64dbca7ce6555bd37d3b6f85ecf41a98e3dd29 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -5011,18 +5011,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
+@@ -5014,18 +5014,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
        return false;
    }
  

+ 0 - 79
patches/node/test_account_for_non-node_basename.patch

@@ -1,79 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Thu, 18 Jun 2020 14:40:35 -0700
-Subject: test: account for non-node basename
-
-Refs https://github.com/nodejs/node/commit/edf75e4299219d57e53f98956b8e27e4945dd5d6.
-
-Because Electron smoketests with Node.js' own specs, it's the case for us that the basename is
-`Electron`. These tests were failing as they're hardcoded to assume it's `node` so this makes
-them more flexible for embedders.
-
-Upstreamed at https://github.com/nodejs/node/pull/33952.
-
-diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out
-index 8840633959a18baf9b40305d73511d47ae213978..64743d4ae67acf1f8cb28b832b1f7204ace48952 100644
---- a/test/message/eval_messages.out
-+++ b/test/message/eval_messages.out
-@@ -55,11 +55,11 @@ ReferenceError: y is not defined
- 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)
- 
- [eval]:1
- 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)
- done
-diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out
-index 72edb0b00b28cd6cf6bac51519be4fde4708b161..3c71c5683b7d949bc7b1a46e7cbd4473c40cf871 100644
---- a/test/message/stdin_messages.out
-+++ b/test/message/stdin_messages.out
-@@ -67,11 +67,11 @@ ReferenceError: y is not defined
- 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)
- 
- [stdin]:1
- 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)
- done
-diff --git a/test/message/throw_error_with_getter_throw.out b/test/message/throw_error_with_getter_throw.out
-index 5daf35aad44ce37e3681d73d19c7e0eb7e7c3439..2162185e7845fcc5f716aa652e253db95462a622 100644
---- a/test/message/throw_error_with_getter_throw.out
-+++ b/test/message/throw_error_with_getter_throw.out
-@@ -3,4 +3,4 @@
- throw {  // eslint-disable-line no-throw-literal
- ^
- [object Object]
--(Use `node --trace-uncaught ...` to show where the exception was thrown)
-+(Use `* --trace-uncaught ...` to show where the exception was thrown)
-diff --git a/test/message/throw_null.out b/test/message/throw_null.out
-index db6cc3edf583eff7c815ea4fe24c3ecc60b03888..c97dcbfe134a22721d68f2bb5570d8e59450c3bb 100644
---- a/test/message/throw_null.out
-+++ b/test/message/throw_null.out
-@@ -3,4 +3,4 @@
- throw null;
- ^
- null
--(Use `node --trace-uncaught ...` to show where the exception was thrown)
-+(Use `* --trace-uncaught ...` to show where the exception was thrown)
-diff --git a/test/message/throw_undefined.out b/test/message/throw_undefined.out
-index 016eb8ffd95e3389c93e24912d71ccb152fd99d7..4b2bfdbc5907085b19f43ba1306aaa6efc41beee 100644
---- a/test/message/throw_undefined.out
-+++ b/test/message/throw_undefined.out
-@@ -3,4 +3,4 @@
- throw undefined;
- ^
- undefined
--(Use `node --trace-uncaught ...` to show where the exception was thrown)
-+(Use `* --trace-uncaught ...` to show where the exception was thrown)

+ 10 - 5
spec/asar-spec.js

@@ -1426,15 +1426,20 @@ describe('asar package', function () {
     });
 
     describe('internalModuleReadJSON', function () {
-      const internalModuleReadJSON = process.binding('fs').internalModuleReadJSON;
+      const { internalModuleReadJSON } = process.binding('fs');
 
-      it('read a normal file', function () {
+      it('reads a normal file', function () {
         const file1 = path.join(asarDir, 'a.asar', 'file1');
-        expect(internalModuleReadJSON(file1).toString().trim()).to.equal('file1');
+        const [s1, c1] = internalModuleReadJSON(file1);
+        expect([s1.toString().trim(), c1]).to.eql(['file1', true]);
+
         const file2 = path.join(asarDir, 'a.asar', 'file2');
-        expect(internalModuleReadJSON(file2).toString().trim()).to.equal('file2');
+        const [s2, c2] = internalModuleReadJSON(file2);
+        expect([s2.toString().trim(), c2]).to.eql(['file2', true]);
+
         const file3 = path.join(asarDir, 'a.asar', 'file3');
-        expect(internalModuleReadJSON(file3).toString().trim()).to.equal('file3');
+        const [s3, c3] = internalModuleReadJSON(file3);
+        expect([s3.toString().trim(), c3]).to.eql(['file3', true]);
       });
 
       it('reads a normal file with unpacked files', function () {