Browse Source

chore: bump node to v12.16.2 (master) (#23057)

Co-authored-by: Shelley Vohr <[email protected]>
Electron Bot 5 years ago
parent
commit
fdf7e288bb
33 changed files with 163 additions and 380 deletions
  1. 1 1
      DEPS
  2. 0 8
      patches/node/.patches
  3. 0 44
      patches/node/64bit_bump_typedarray_max_length_to_2_32-1_elements.patch
  4. 19 7
      patches/node/build_add_gn_build_files.patch
  5. 2 2
      patches/node/build_bring_back_node_with_ltcg_configuration.patch
  6. 6 6
      patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
  7. 5 5
      patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
  8. 2 2
      patches/node/expose_get_builtin_module_function.patch
  9. 10 10
      patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch
  10. 0 38
      patches/node/fix_--perf-prof_only_works_on_linux.patch
  11. 1 1
      patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
  12. 3 3
      patches/node/fix_build_and_expose_inspector_agent.patch
  13. 0 58
      patches/node/fix_don_t_preparemainexecution_twice.patch
  14. 0 20
      patches/node/fix_ensure_clocks_header_included_in_impl.patch
  15. 1 1
      patches/node/fix_expose_internalcallbackscope.patch
  16. 5 5
      patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
  17. 0 30
      patches/node/fix_include_io_h_in_uvwasi_for_win.patch
  18. 0 23
      patches/node/fix_include_libuv_header_in_node_binding.patch
  19. 82 10
      patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch
  20. 0 58
      patches/node/fix_remove_implicit_type_conversions.patch
  21. 3 3
      patches/node/fix_use_crypto_impls_for_compat.patch
  22. 0 23
      patches/node/fix_use_hex_not_decimal_for_clarity.patch
  23. 2 2
      patches/node/fixme_comment_trace_event_macro.patch
  24. 1 1
      patches/node/fixme_remove_async_id_assertion_check.patch
  25. 2 2
      patches/node/fixme_use_redefined_version_of_internalmodulestat.patch
  26. 2 2
      patches/node/make_module_globalpaths_a_reference.patch
  27. 1 1
      patches/node/override_existing_v8_reallocate.patch
  28. 3 3
      patches/node/pass_all_globals_through_require.patch
  29. 3 3
      patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch
  30. 2 2
      patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
  31. 2 2
      patches/node/revert_crypto_add_oaeplabel_option.patch
  32. 1 0
      script/node-disabled-tests.json
  33. 4 4
      shell/browser/node_debugger.cc

+ 1 - 1
DEPS

@@ -14,7 +14,7 @@ vars = {
   'chromium_version':
     'e7c84a47c0598ebf6c3f0b7bd96bdb1a4b42208f',
   'node_version':
-    'v12.16.1',
+    'v12.16.2',
   'nan_version':
     '2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
 

+ 0 - 8
patches/node/.patches

@@ -26,19 +26,11 @@ build_bring_back_node_with_ltcg_configuration.patch
 revert_crypto_add_oaeplabel_option.patch
 refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
 enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
-fix_include_libuv_header_in_node_binding.patch
 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_use_crypto_impls_for_compat.patch
-fix_ensure_clocks_header_included_in_impl.patch
-fix_remove_implicit_type_conversions.patch
-fix_include_io_h_in_uvwasi_for_win.patch
-fix_--perf-prof_only_works_on_linux.patch
 fix_we_need_to_eager-load_cjs_modules.patch
-fix_don_t_preparemainexecution_twice.patch
 avoid_calling_deprecated_method.patch
 remove_deprecated_wasm_module_type_check.patch
 weakrefs_rename_finalizationgroup_to_finalizationregistry_for_js.patch

+ 0 - 44
patches/node/64bit_bump_typedarray_max_length_to_2_32-1_elements.patch

@@ -1,44 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: John Kleinschmidt <[email protected]>
-Date: Tue, 28 Jan 2020 12:16:11 -0500
-Subject: Bump TypedArray max length to 2**32-1 elements
-
-TypedArray max length for 64 bit has been changed to 2**32-1 elements
-See: https://source.chromium.org/chromium/_/chromium/v8/v8.git/+/3bff8fa5ea29c0623c0a5601b6fa67c64cbcc319
-
-diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js
-index 75bcb03d1913c4d0c5825fbc2931aa6e84f922ed..9b7a64607edfc227e0473ae11075ca9b83419739 100644
---- a/test/parallel/test-buffer-alloc.js
-+++ b/test/parallel/test-buffer-alloc.js
-@@ -8,8 +8,8 @@ const SlowBuffer = require('buffer').SlowBuffer;
- // Verify the maximum Uint8Array size. There is no concrete limit by spec. The
- // internal limits should be updated if this fails.
- assert.throws(
--  () => new Uint8Array(2 ** 31),
--  { message: 'Invalid typed array length: 2147483648' }
-+  () => new Uint8Array(2 ** 32),
-+  { message: 'Invalid typed array length: 4294967296' }
- );
- 
- const b = Buffer.allocUnsafe(1024);
-diff --git a/test/parallel/test-buffer-over-max-length.js b/test/parallel/test-buffer-over-max-length.js
-index b1267b19ff439e344417a85649667facb0d2add7..5a738050eda9c0adad862d318f390af112330c14 100644
---- a/test/parallel/test-buffer-over-max-length.js
-+++ b/test/parallel/test-buffer-over-max-length.js
-@@ -10,7 +10,7 @@ const bufferMaxSizeMsg = common.expectsError({
-   code: 'ERR_INVALID_OPT_VALUE',
-   type: RangeError,
-   message: /^The value "[^"]*" is invalid for option "size"$/
--}, 12);
-+}, 10);
- 
- assert.throws(() => Buffer((-1 >>> 0) + 1), bufferMaxSizeMsg);
- assert.throws(() => SlowBuffer((-1 >>> 0) + 1), bufferMaxSizeMsg);
-@@ -23,7 +23,3 @@ assert.throws(() => SlowBuffer(kMaxLength + 1), bufferMaxSizeMsg);
- assert.throws(() => Buffer.alloc(kMaxLength + 1), bufferMaxSizeMsg);
- assert.throws(() => Buffer.allocUnsafe(kMaxLength + 1), bufferMaxSizeMsg);
- assert.throws(() => Buffer.allocUnsafeSlow(kMaxLength + 1), bufferMaxSizeMsg);
--
--// issue GH-4331
--assert.throws(() => Buffer.allocUnsafe(0xFFFFFFFF), bufferMaxSizeMsg);
--assert.throws(() => Buffer.allocUnsafe(0xFFFFFFFFF), bufferMaxSizeMsg);

+ 19 - 7
patches/node/build_add_gn_build_files.patch

@@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP.
 
 diff --git a/BUILD.gn b/BUILD.gn
 new file mode 100644
-index 0000000000000000000000000000000000000000..e4aab62b85e6ea1eac68cc21056081b4ff4bd1d6
+index 0000000000000000000000000000000000000000..22d119036d12c396af935fe85ae18751e6d80562
 --- /dev/null
 +++ b/BUILD.gn
-@@ -0,0 +1,358 @@
+@@ -0,0 +1,360 @@
 +import("//electron/build/asar.gni")
 +import("//v8/gni/v8.gni")
 +
@@ -275,6 +275,8 @@ index 0000000000000000000000000000000000000000..e4aab62b85e6ea1eac68cc21056081b4
 +    sources += [
 +      "src/node_crypto.cc",
 +      "src/node_crypto.h",
++      "src/node_crypto_common.cc", 
++      "src/node_crypto_common.h",
 +      "src/node_crypto_bio.cc",
 +      "src/node_crypto_bio.h",
 +      "src/node_crypto_clienthello-inl.h",
@@ -814,10 +816,10 @@ index 0000000000000000000000000000000000000000..67116f2070bb9200aace81afdf0b1e7a
 +}
 diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
 new file mode 100644
-index 0000000000000000000000000000000000000000..e9beace20f25e270dd80509bd6d5871b140d5b79
+index 0000000000000000000000000000000000000000..6df1a603d5b2887e22e8e2863bb04c7128ab5eec
 --- /dev/null
 +++ b/deps/uvwasi/BUILD.gn
-@@ -0,0 +1,34 @@
+@@ -0,0 +1,35 @@
 +config("uvwasi_config") {
 +  include_dirs = [ "include" ]
 +}
@@ -850,6 +852,7 @@ index 0000000000000000000000000000000000000000..e9beace20f25e270dd80509bd6d5871b
 +    "src/fd_table.c",
 +    "src/uv_mapping.c",
 +    "src/uvwasi.c",
++    "src/wasi_rights.c",
 +  ]
 +}
 diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn
@@ -918,10 +921,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
 +}
 diff --git a/filenames.json b/filenames.json
 new file mode 100644
-index 0000000000000000000000000000000000000000..d325cdc5ca7a323834c6962fa43d2c9ff38a5728
+index 0000000000000000000000000000000000000000..78dff9e0458aaa6b864259f3001764c77b977e36
 --- /dev/null
 +++ b/filenames.json
-@@ -0,0 +1,460 @@
+@@ -0,0 +1,469 @@
 +// This file is automatically generated by generate_gn_filenames_json.py
 +// DO NOT EDIT
 +{
@@ -939,8 +942,15 @@ index 0000000000000000000000000000000000000000..d325cdc5ca7a323834c6962fa43d2c9f
 +      ]
 +    },
 +    {
++      "dest_dir": "include/node//cppgc/",
++      "files": [
++        "//v8/include/cppgc/finalizer-trait.h"
++      ]
++    },
++    {
 +      "dest_dir": "include/node//",
 +      "files": [
++        "//v8/include/v8-fast-api-calls.h",
 +        "//v8/include/v8-internal.h",
 +        "//v8/include/v8-platform.h",
 +        "//v8/include/v8-profiler.h",
@@ -990,6 +1000,7 @@ index 0000000000000000000000000000000000000000..d325cdc5ca7a323834c6962fa43d2c9f
 +    }
 +  ],
 +  "library_files": [
++    "lib/internal/bootstrap/environment.js",
 +    "lib/internal/bootstrap/loaders.js",
 +    "lib/internal/bootstrap/node.js",
 +    "lib/internal/bootstrap/pre_execution.js",
@@ -1302,6 +1313,7 @@ index 0000000000000000000000000000000000000000..d325cdc5ca7a323834c6962fa43d2c9f
 +    "src/connect_wrap.h",
 +    "src/connection_wrap.h",
 +    "src/debug_utils.h",
++    "src/debug_utils-inl.h",
 +    "src/env.h",
 +    "src/env-inl.h",
 +    "src/handle_wrap.h",
@@ -1588,7 +1600,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 88831ab19d72014f3e92c80516dc6c9d76e16158..01377c95b74879e74ca476eda6899e69597b9d89 100644
+index 8a4192dcc74c8809f47e862f673b850a40084577..29dab977e8a31dfb5aae44bf4b03e855ee18aff0 100644
 --- a/src/node_version.h
 +++ b/src/node_version.h
 @@ -89,7 +89,10 @@

+ 2 - 2
patches/node/build_bring_back_node_with_ltcg_configuration.patch

@@ -10,7 +10,7 @@ THe fix for this should land in node-gyp as discussed in above issue,
 landing this as temporary patch.
 
 diff --git a/common.gypi b/common.gypi
-index 0000f6eaea5cbfb793750c0592c1bb912cbe0a14..6ed509d81d14211f608495263f11a1d2cbc5013c 100644
+index bf6dda11463d0bee97262ccc6d344d8b2efad8d2..87f5a3bd3b741d58e956cad4599012a11d46ba29 100644
 --- a/common.gypi
 +++ b/common.gypi
 @@ -19,7 +19,7 @@
@@ -22,7 +22,7 @@ index 0000f6eaea5cbfb793750c0592c1bb912cbe0a14..6ed509d81d14211f608495263f11a1d2
      'node_shared_openssl%': 'false',
  
      'node_tag%': '',
-@@ -240,6 +240,26 @@
+@@ -243,6 +243,26 @@
              'cflags': [ '-fPIC' ],
              'ldflags': [ '-fPIC' ]
            }],

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

@@ -23,10 +23,10 @@ index cef4e5086ca8160a7d715915f735963e369068b1..35ad9ee1a685177894bb5c13c58c16af
  
    // 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 22912e7c89b4cba78315269c3e009bfca1ccec27..8d6fc381330867f40740c1e2e327a05cc4045785 100644
+index 8bb5dae46966541884dbad5bb9c3a3f790c56358..6bc051ca5b864945aedea7a6fa8cf23cb509f9e9 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1129,6 +1129,13 @@ Module.prototype._compile = function(content, filename) {
+@@ -1127,6 +1127,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,12 +41,12 @@ index 22912e7c89b4cba78315269c3e009bfca1ccec27..8d6fc381330867f40740c1e2e327a05c
          try {
            resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
 diff --git a/src/env.h b/src/env.h
-index 4e625f34741c0cf1cd175baf0189406140124ceb..aa40bdc3ccd963b8b6f48d52378801f88f87b733 100644
+index e5e8c107f6881d96e1d8a2b55fff425d5e29b0a4..6a7263736b5252e9ce36269a5be9c58dd031ee94 100644
 --- a/src/env.h
 +++ b/src/env.h
-@@ -911,6 +911,15 @@ class Environment : public MemoryRetainer {
+@@ -878,6 +878,15 @@ class Environment : public MemoryRetainer {
                uint64_t thread_id = kNoThreadId);
-   ~Environment();
+   ~Environment() override;
  
 +  void ForceOnlyContextAwareNativeModules() {
 +    force_context_aware_ = true;
@@ -60,7 +60,7 @@ index 4e625f34741c0cf1cd175baf0189406140124ceb..aa40bdc3ccd963b8b6f48d52378801f8
    void InitializeLibuv(bool start_profiler_idle_notifier);
    inline const std::vector<std::string>& exec_argv();
    inline const std::vector<std::string>& argv();
-@@ -1280,6 +1289,9 @@ class Environment : public MemoryRetainer {
+@@ -1263,6 +1272,9 @@ class Environment : public MemoryRetainer {
    inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
                           const char* errmsg);
  

+ 5 - 5
patches/node/enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch

@@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
 out in memory on 64-bit machines, and will summarily fail to work.
 
 diff --git a/common.gypi b/common.gypi
-index 6ed509d81d14211f608495263f11a1d2cbc5013c..26a3b48dbfb4b066d86e4eaa73d870a442ccbdaa 100644
+index 87f5a3bd3b741d58e956cad4599012a11d46ba29..23958d5535819fd9d1a14868aea3cc39762a102f 100644
 --- a/common.gypi
 +++ b/common.gypi
 @@ -75,6 +75,9 @@
@@ -28,10 +28,10 @@ index 6ed509d81d14211f608495263f11a1d2cbc5013c..26a3b48dbfb4b066d86e4eaa73d870a4
 +      ['target_arch == "arm64" or target_arch == "x64"', {
 +        'v8_enable_pointer_compression': 1,
 +      }],
-     ],
-   },
- 
-@@ -375,6 +381,12 @@
+       ['target_arch in "ppc64 s390x"', {
+         'v8_enable_backtrace': 1,
+       }],
+@@ -378,6 +384,12 @@
            }],
          ],
        }],

+ 2 - 2
patches/node/expose_get_builtin_module_function.patch

@@ -24,10 +24,10 @@ index 0facfc36cbcb784cd0a1802a7748dff3366710fd..db60617cebee83ac09371aa1e2200280
    Environment* env = Environment::GetCurrent(args);
  
 diff --git a/src/node_binding.h b/src/node_binding.h
-index 42f3c5b8d00880588f442a4e724e080128c56dfe..cefb6419ebb7f5c5c79927d179eef0a790e234ad 100644
+index 5bced5b41431dc7838d1a30774a1a41ff797290e..4233ee968fb4b3b5456997cbf1450ecf07392455 100644
 --- a/src/node_binding.h
 +++ b/src/node_binding.h
-@@ -90,6 +90,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
+@@ -91,6 +91,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
  void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
  void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);
  

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

@@ -24,10 +24,10 @@ 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/env.cc b/src/env.cc
-index 3dbc56b7c56bee90b76ade6af610105d1e0e916e..2678de6f7dcab8efb1ea506ae9861e07df5544f1 100644
+index 2bdac964cb03cad4b9637c3cea56a8e5f650056f..4b1c72a5f67ab1882cbb61b4c52fc50e28aa5b25 100644
 --- a/src/env.cc
 +++ b/src/env.cc
-@@ -385,6 +385,12 @@ Environment::Environment(IsolateData* isolate_data,
+@@ -384,6 +384,12 @@ Environment::Environment(IsolateData* isolate_data,
    // TODO(joyeecheung): deserialize when the snapshot covers the environment
    // properties.
    CreateProperties();
@@ -41,7 +41,7 @@ index 3dbc56b7c56bee90b76ade6af610105d1e0e916e..2678de6f7dcab8efb1ea506ae9861e07
  
  Environment::~Environment() {
 diff --git a/src/node.cc b/src/node.cc
-index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd6b7f8ee6 100644
+index fee485f86e17f1987e140aea874656e5048cdbfe..7dda6b39c37cdf96f59a34ca6bc75ea2c7fde060 100644
 --- a/src/node.cc
 +++ b/src/node.cc
 @@ -27,6 +27,7 @@
@@ -52,7 +52,7 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
  #include "node_internals.h"
  #include "node_main_instance.h"
  #include "node_metadata.h"
-@@ -131,6 +132,9 @@ using v8::Undefined;
+@@ -128,6 +129,9 @@ using v8::Undefined;
  using v8::V8;
  using v8::Value;
  
@@ -62,7 +62,7 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
  namespace per_process {
  
  // node_revert.h
-@@ -362,6 +366,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
+@@ -343,6 +347,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
  
    CHECK(!has_run_bootstrapping_code());
  
@@ -76,7 +76,7 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
    if (BootstrapInternalLoaders().IsEmpty()) {
      return MaybeLocal<Value>();
    }
-@@ -752,7 +763,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -726,7 +737,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    binding::RegisterBuiltinModules();
  
    // Make inherited handles noninheritable.
@@ -87,7 +87,7 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
  
  #ifdef NODE_REPORT
    // Cache the original command line to be
-@@ -849,6 +862,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -762,6 +775,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
      if (exit_code != 0) return exit_code;
    }
  #endif
@@ -96,7 +96,7 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
  
    const int exit_code = ProcessGlobalArgs(argv,
                                            exec_argv,
-@@ -893,6 +908,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -806,6 +821,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    }
    per_process::metadata.versions.InitializeIntlVersions();
  #endif
@@ -105,10 +105,10 @@ index 80916e5244aa36da1e3a0a91887ab134f14f8b3d..cc634682f5aedf8f92fd6d8a9e26dfcd
    NativeModuleEnv::InitializeCodeCache();
  
 diff --git a/src/node.h b/src/node.h
-index aadb60ea557f43a0e1c942183fb14dc915248e59..9dc4c199ca8a9650473bc6d16238e55b3bfd6fd0 100644
+index 886216e2cb533e7337bc4f6816e2de796f64f81e..19d5eff164a543a38b4c77f99c2f15c30a226f77 100644
 --- a/src/node.h
 +++ b/src/node.h
-@@ -203,6 +203,9 @@ namespace node {
+@@ -211,6 +211,9 @@ namespace node {
  
  class IsolateData;
  class Environment;

+ 0 - 38
patches/node/fix_--perf-prof_only_works_on_linux.patch

@@ -1,38 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Thu, 20 Feb 2020 17:22:58 -0800
-Subject: fix: --perf-prof only works on Linux
-
-`--perf-prof`-related flags have been removed in V8 on non-linux devices.
-
-See:
-* https://chromium-review.googlesource.com/c/v8/v8/+/1993969
-* https://chromium-review.googlesource.com/c/v8/v8/+/1993978
-
-Upstreamed in https://github.com/nodejs/node/pull/31892.
-
-diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
-index 698f463b627644a85db0fcddfcd471ebd91934e5..63cb22c8693447da94f4ba2f8c4082ea6bf49d6a 100644
---- a/test/parallel/test-cli-node-options.js
-+++ b/test/parallel/test-cli-node-options.js
-@@ -41,15 +41,14 @@ expect('--trace-event-file-pattern {pid}-${rotation}.trace_events ' +
-        '--trace-event-categories node.async_hooks', 'B\n');
- expect('--unhandled-rejections=none', 'B\n');
- 
--if (!common.isWindows) {
-+if (common.isLinux) {
-   expect('--perf-basic-prof', 'B\n');
-   expect('--perf-basic-prof-only-functions', 'B\n');
--}
- 
--if (common.isLinux && ['arm', 'x64'].includes(process.arch)) {
--  // PerfJitLogger is only implemented in Linux.
--  expect('--perf-prof', 'B\n');
--  expect('--perf-prof-unwinding-info', 'B\n');
-+  if (['arm', 'x64'].includes(process.arch)) {
-+    expect('--perf-prof', 'B\n');
-+    expect('--perf-prof-unwinding-info', 'B\n');
-+  }
- }
- 
- if (common.hasCrypto) {

+ 1 - 1
patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch

@@ -8,7 +8,7 @@ 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 8c9076b7352d81c44d8a177f4b039f69bce2aefb..0000f6eaea5cbfb793750c0592c1bb912cbe0a14 100644
+index 38a22fc5f1ddd6164291c5d21df8fc1203bcc2b7..bf6dda11463d0bee97262ccc6d344d8b2efad8d2 100644
 --- a/common.gypi
 +++ b/common.gypi
 @@ -77,6 +77,22 @@

+ 3 - 3
patches/node/fix_build_and_expose_inspector_agent.patch

@@ -6,7 +6,7 @@ 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 aff52a5a5eccd175fae4f82ffcf9897ad43763ee..e55862ca202caaa9ec9800b40215232f98120476 100644
+index 94433b75d0fdb2ef902e20a60288995fcbf2bbac..3e865357f409470f15ed29a3f87b717812637c37 100644
 --- a/src/inspector_agent.cc
 +++ b/src/inspector_agent.cc
 @@ -222,7 +222,7 @@ const int CONTEXT_GROUP_ID = 1;
@@ -28,7 +28,7 @@ index aff52a5a5eccd175fae4f82ffcf9897ad43763ee..e55862ca202caaa9ec9800b40215232f
      info.is_default = true;
      contextCreated(env->context(), info);
 diff --git a/src/inspector_agent.h b/src/inspector_agent.h
-index d5088a1b5469044a3f694522c547c901d7cd91f8..19bdf7e6e7e8df944eb76e52e63957dc4cffdab8 100644
+index 089077370db049a7e6d00ff2bf4d6b61cbc427d9..5594f4ba637c5c890a8226d9face18815c41a97b 100644
 --- a/src/inspector_agent.h
 +++ b/src/inspector_agent.h
 @@ -6,7 +6,9 @@
@@ -51,7 +51,7 @@ index d5088a1b5469044a3f694522c547c901d7cd91f8..19bdf7e6e7e8df944eb76e52e63957dc
    explicit Agent(node::Environment* env);
    ~Agent();
 diff --git a/src/inspector_io.cc b/src/inspector_io.cc
-index 76e481c9530d955a841a19d91b34f03bebaaecfb..8b61d73b8d7cc5d84a61b4a683a28ab1865ad71b 100644
+index 75290317d2fcae8585ac8d91f49add5fdd0d79c0..8af7427c463e98705dc7a6a4c86341faec3620b2 100644
 --- a/src/inspector_io.cc
 +++ b/src/inspector_io.cc
 @@ -13,6 +13,8 @@

+ 0 - 58
patches/node/fix_don_t_preparemainexecution_twice.patch

@@ -1,58 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Fri, 21 Feb 2020 17:21:11 -0800
-Subject: fix: don't prepareMainExecution twice
-
-In https://github.com/nodejs/node/pull/26788 (v12.0.0), Node.js added a
-bootstrapper to `CreateEnvironment`, which would prepare the main thread
-for execution any time an embedder created a new environment. However, this
-caused an unfortunate doubling-up effect; Node.js also ran bootstrapping
-(called `prepareMainThreadExecution`) for all other execution paths
-(like the repl, the actual main module, eval, etc).
-
-To fix this, we can just remove bootstrapping code from `CreateEnvironment`.
-
-diff --git a/lib/internal/bootstrap/environment.js b/lib/internal/bootstrap/environment.js
-deleted file mode 100644
-index 79a67dae378202ee377f2f138560b74f673af6e4..0000000000000000000000000000000000000000
---- a/lib/internal/bootstrap/environment.js
-+++ /dev/null
-@@ -1,13 +0,0 @@
--'use strict';
--
--// This runs necessary preparations to prepare a complete Node.js context
--// that depends on run time states.
--// It is currently only intended for preparing contexts for embedders.
--
--/* global markBootstrapComplete */
--const {
--  prepareMainThreadExecution
--} = require('internal/bootstrap/pre_execution');
--
--prepareMainThreadExecution();
--markBootstrapComplete();
-diff --git a/src/api/environment.cc b/src/api/environment.cc
-index 8d8f820962d540c67d261a65ce5d5def5db40696..46fb07731b160765059f60bc28bd6992d4b9e36d 100644
---- a/src/api/environment.cc
-+++ b/src/api/environment.cc
-@@ -316,20 +316,6 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
-   if (env->RunBootstrapping().IsEmpty()) {
-     return nullptr;
-   }
--
--  std::vector<Local<String>> parameters = {
--      env->require_string(),
--      FIXED_ONE_BYTE_STRING(env->isolate(), "markBootstrapComplete")};
--  std::vector<Local<Value>> arguments = {
--      env->native_module_require(),
--      env->NewFunctionTemplate(MarkBootstrapComplete)
--          ->GetFunction(env->context())
--          .ToLocalChecked()};
--  if (ExecuteBootstrapper(
--          env, "internal/bootstrap/environment", &parameters, &arguments)
--          .IsEmpty()) {
--    return nullptr;
--  }
-   return env;
- }
- 

+ 0 - 20
patches/node/fix_ensure_clocks_header_included_in_impl.patch

@@ -1,20 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Fri, 14 Feb 2020 14:05:33 -0800
-Subject: fix: ensure clocks header included in impl
-
-Fixes some build errors in uvwasi like: `error: no previous prototype for function 'uvwasi__clock_gettime_realtime'`
-This fix will be upstreamed to uvwasi if possible.
-
-diff --git a/deps/uvwasi/src/clocks.c b/deps/uvwasi/src/clocks.c
-index e1fbc696b62f058cb0007e77bdd2e52a3c26d765..d2ca006530f50a0e8d77e8223b8191fb8e35ff2b 100644
---- a/deps/uvwasi/src/clocks.c
-+++ b/deps/uvwasi/src/clocks.c
-@@ -1,3 +1,7 @@
-+#ifdef _WIN32
-+#include "clocks.h"
-+#endif /* _WIN32 */
-+
- #ifndef _WIN32
- # include <errno.h>
- # include <sys/time.h>

+ 1 - 1
patches/node/fix_expose_internalcallbackscope.patch

@@ -6,7 +6,7 @@ Subject: fix: expose InternalCallbackScope
 This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it.
 
 diff --git a/src/node_internals.h b/src/node_internals.h
-index 114498458a9fd69e636a8e68c30e4b93937406d7..c5b4a084e85b48d5e2121a1ebcfd0c4e4b081852 100644
+index 0ba13ceaea2ea2d37dcf202afa354a845f381463..97d78b4bacdbc64e03ed8eedae0995459e3cbc16 100644
 --- a/src/node_internals.h
 +++ b/src/node_internals.h
 @@ -203,7 +203,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(

+ 5 - 5
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 4cb2da4b860ecf147e37cb3c317d445bdf510969..8d8f820962d540c67d261a65ce5d5def5db40696 100644
+index 48c45b6e5e3eb996599ba235c1057756dcd910f3..4b8c64a88fe2b8b30c746bc3c49d75565a83762d 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
-@@ -346,6 +346,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
+@@ -331,6 +331,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
    return per_process::v8_platform.Platform();
  }
  
@@ -20,10 +20,10 @@ index 4cb2da4b860ecf147e37cb3c317d445bdf510969..8d8f820962d540c67d261a65ce5d5def
      int thread_pool_size,
      node::tracing::TracingController* tracing_controller) {
 diff --git a/src/node.h b/src/node.h
-index 9dc4c199ca8a9650473bc6d16238e55b3bfd6fd0..88f0bab9351a030cb316c0ccd1e25dfdc56be918 100644
+index 19d5eff164a543a38b4c77f99c2f15c30a226f77..709d03145e3d5acdb67502110917e8147c275c60 100644
 --- a/src/node.h
 +++ b/src/node.h
-@@ -108,6 +108,7 @@ namespace node {
+@@ -116,6 +116,7 @@ namespace node {
  
  namespace tracing {
  
@@ -31,7 +31,7 @@ index 9dc4c199ca8a9650473bc6d16238e55b3bfd6fd0..88f0bab9351a030cb316c0ccd1e25dfd
  class TracingController;
  
  }
-@@ -379,6 +380,8 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
+@@ -387,6 +388,8 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
  // it returns nullptr.
  NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform();
  

+ 0 - 30
patches/node/fix_include_io_h_in_uvwasi_for_win.patch

@@ -1,30 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Tue, 18 Feb 2020 16:42:14 -0800
-Subject: fix: include io.h in uvwasi for win
-
-io.h must be explicitly included, or '_lseeki64' will error
-as undefined.
-
-Already fixed upstream in https://github.com/cjihrig/uvwasi/pull/81.
-
-diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c
-index 28c6dcc26104c928f132117b790ee63d17bad805..44b353caaf3966fa5cc1d5b7ae8ba9f47c6ea057 100644
---- a/deps/uvwasi/src/uvwasi.c
-+++ b/deps/uvwasi/src/uvwasi.c
-@@ -3,6 +3,7 @@
- 
- #ifndef _WIN32
- # include <sched.h>
-+# include <stdio.h>
- # include <sys/types.h>
- # include <unistd.h>
- # include <dirent.h>
-@@ -11,6 +12,7 @@
- # define SLASH_STR "/"
- # define IS_SLASH(c) ((c) == '/')
- #else
-+# include <io.h>
- # define SLASH '\\'
- # define SLASH_STR "\\"
- # define IS_SLASH(c) ((c) == '/' || (c) == '\\')

+ 0 - 23
patches/node/fix_include_libuv_header_in_node_binding.patch

@@ -1,23 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Wed, 8 Jan 2020 12:54:07 -0800
-Subject: fix: include libuv header in node_binding
-
-The libuv header uv.h was removed in
-https://github.com/nodejs/node/commit/3bb085dbad4d23030c731834e35b2804c8a50b23,
-but is necessary for Windows to understand what uv_lib_t is.
-
-Upstreamed in https://github.com/nodejs/node/pull/31265.
-
-diff --git a/src/node_binding.h b/src/node_binding.h
-index cefb6419ebb7f5c5c79927d179eef0a790e234ad..4233ee968fb4b3b5456997cbf1450ecf07392455 100644
---- a/src/node_binding.h
-+++ b/src/node_binding.h
-@@ -10,6 +10,7 @@
- #include "node.h"
- #define NAPI_EXPERIMENTAL
- #include "node_api.h"
-+#include "uv.h"
- 
- enum {
-   NM_F_BUILTIN = 1 << 0,  // Unused.

+ 82 - 10
patches/node/fix_key_gen_apis_are_not_available_in_boringssl.patch

@@ -6,10 +6,10 @@ 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 e0684d9b410c2423d805dd076330b79d22356f35..e33a5d11ddbf900b26c1baa62f65bae49cdbaa24 100644
+index 4e1a4d8bc80fe3619826b2c865fd0503ffc66c5c..41eb04caffd4c1faaecd0f8a2cbe93016475bfe1 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -290,24 +290,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
+@@ -267,24 +267,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
      V(BIO)                                                                    \
      V(PKCS7)                                                                  \
      V(X509V3)                                                                 \
@@ -34,21 +34,93 @@ index e0684d9b410c2423d805dd076330b79d22356f35..e33a5d11ddbf900b26c1baa62f65bae4
      V(USER)                                                                   \
  
  #define V(name) case ERR_LIB_##name: lib = #name "_"; break;
-@@ -6552,6 +6542,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+@@ -6017,6 +6007,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
      if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
        return nullptr;
  
-+    // FIXME(zcbenz): This is not available in BoringSSL.
 +#ifndef OPENSSL_IS_BORINGSSL
      if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
        return nullptr;
  
-@@ -6571,6 +6563,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
- 
-     EVPKeyCtxPointer key_ctx(EVP_PKEY_CTX_new(params.get(), nullptr));
-     return key_ctx;
+@@ -6027,6 +6018,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+         return nullptr;
+       }
+     }
 +#endif
-+    return nullptr;
+ 
+     EVP_PKEY* raw_params = nullptr;
+     if (EVP_PKEY_paramgen(param_ctx.get(), &raw_params) <= 0)
+diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc
+index 197bc5cd5913a40269d5704f0f9d5aa1383c2f17..d0c1dc5387120c107696175e3515e81053fbeb21 100644
+--- a/src/node_crypto_common.cc
++++ b/src/node_crypto_common.cc
+@@ -237,10 +237,10 @@ int UseSNIContext(const SSLPointer& ssl, SecureContext* context) {
+ }
+ 
+ const char* GetClientHelloALPN(const SSLPointer& ssl) {
++#ifndef OPENSSL_IS_BORINGSSL
+   const unsigned char* buf;
+   size_t len;
+   size_t rem;
+-
+   if (!SSL_client_hello_get0_ext(
+           ssl.get(),
+           TLSEXT_TYPE_application_layer_protocol_negotiation,
+@@ -249,17 +249,18 @@ const char* GetClientHelloALPN(const SSLPointer& ssl) {
+       rem < 2) {
+     return nullptr;
    }
+-
+   len = (buf[0] << 8) | buf[1];
+   if (len + 2 != rem) return nullptr;
+   return reinterpret_cast<const char*>(buf + 3);
++#endif
++  return nullptr;
+ }
+ 
+ const char* GetClientHelloServerName(const SSLPointer& ssl) {
++#ifndef OPENSSL_IS_BORINGSSL
+   const unsigned char* buf;
+   size_t len;
+   size_t rem;
+-
+   if (!SSL_client_hello_get0_ext(
+           ssl.get(),
+           TLSEXT_TYPE_server_name,
+@@ -281,6 +282,8 @@ const char* GetClientHelloServerName(const SSLPointer& ssl) {
+   if (len + 2 > rem)
+     return nullptr;
+   return reinterpret_cast<const char*>(buf + 5);
++#endif
++  return nullptr;
+ }
+ 
+ const char* GetServerName(SSL* ssl) {
+@@ -288,7 +291,10 @@ const char* GetServerName(SSL* ssl) {
+ }
+ 
+ bool SetGroups(SecureContext* sc, const char* groups) {
++#ifndef OPENSSL_IS_BORINGSSL
+   return SSL_CTX_set1_groups_list(**sc, groups) == 1;
++#endif
++  return false;
+ }
  
-  private:
+ const char* X509ErrorCode(long err) {  // NOLINT(runtime/int)
+@@ -766,13 +772,13 @@ MaybeLocal<Array> GetClientHelloCiphers(
+     Environment* env,
+     const SSLPointer& ssl) {
+   EscapableHandleScope scope(env->isolate());
+-  const unsigned char* buf;
+-  size_t len = SSL_client_hello_get0_ciphers(ssl.get(), &buf);
++  const unsigned char* buf = nullptr;
++  size_t len = 0; // SSL_client_hello_get0_ciphers(ssl.get(), &buf);
+   size_t count = len / 2;
+   MaybeStackBuffer<Local<Value>, 16> ciphers(count);
+   int j = 0;
+   for (size_t n = 0; n < len; n += 2) {
+-    const SSL_CIPHER* cipher = SSL_CIPHER_find(ssl.get(), buf);
++    const SSL_CIPHER* cipher = nullptr; // SSL_CIPHER_find(ssl.get(), buf);
+     buf += 2;
+     Local<Object> obj = Object::New(env->isolate());
+     if (!Set(env->context(),

+ 0 - 58
patches/node/fix_remove_implicit_type_conversions.patch

@@ -1,58 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Fri, 14 Feb 2020 18:54:44 -0800
-Subject: fix: remove implicit type conversions
-
-This PR removes some implicit type conversions from uvwasi. It will be upstreamed.
-
-diff --git a/deps/uvwasi/src/fd_table.c b/deps/uvwasi/src/fd_table.c
-index f3855d4da54dbe5cbcaf0b2e5d56aa8c4f06902b..7ec19bfb38f6772e88a08a370372cd41f2b16108 100644
---- a/deps/uvwasi/src/fd_table.c
-+++ b/deps/uvwasi/src/fd_table.c
-@@ -190,7 +190,7 @@ static uvwasi_errno_t uvwasi__fd_table_insert(uvwasi_t* uvwasi,
-   struct uvwasi_fd_wrap_t** new_fds;
-   uvwasi_errno_t err;
-   uint32_t new_size;
--  int index;
-+  uint32_t index;
-   uint32_t i;
-   int r;
-   size_t mp_len;
-@@ -231,16 +231,17 @@ static uvwasi_errno_t uvwasi__fd_table_insert(uvwasi_t* uvwasi,
-     table->size = new_size;
-   } else {
-     /* The table is big enough, so find an empty slot for the new data. */
--    index = -1;
-+    int valid_slot = 0;
-     for (i = 0; i < table->size; ++i) {
-       if (table->fds[i] == NULL) {
-+        valid_slot = 1;
-         index = i;
-         break;
-       }
-     }
- 
-     /* index should never be -1. */
--    if (index == -1) {
-+    if (!valid_slot) {
-       uvwasi__free(uvwasi, entry);
-       err = UVWASI_ENOSPC;
-       goto exit;
-@@ -283,7 +284,7 @@ uvwasi_errno_t uvwasi_fd_table_init(uvwasi_t* uvwasi,
-   uvwasi_rights_t base;
-   uvwasi_rights_t inheriting;
-   uvwasi_errno_t err;
--  uvwasi_fd_t i;
-+  int i;
-   int r;
- 
-   /* Require an initial size of at least three to store the stdio FDs. */
-@@ -335,7 +336,7 @@ uvwasi_errno_t uvwasi_fd_table_init(uvwasi_t* uvwasi,
-     if (err != UVWASI_ESUCCESS)
-       goto error_exit;
- 
--    if (wrap->id != i || wrap->id != (uvwasi_fd_t) wrap->fd) {
-+    if ((int) wrap->id != i || wrap->id != (uvwasi_fd_t) wrap->fd) {
-       err = UVWASI_EBADF;
-       goto error_exit;
-     }

+ 3 - 3
patches/node/fix_use_crypto_impls_for_compat.patch

@@ -8,10 +8,10 @@ patch works around that problem by using the implementations of those functions
 found in the OpenSSL repo. I plan to upstream a version of this.
 
 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
-index 3c2393a1c674250f7bd262ee5dbc30330c9f2a58..ac1b57efaebbef7da1bb38b587146edad81289db 100644
+index 5e00468aac8b9f9c5ef7ea2f1e3b62991bfde255..c22989e1dae04b05cda1163e1583213ef990ecab 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -5021,7 +5021,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
+@@ -4481,7 +4481,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.
@@ -20,7 +20,7 @@ index 3c2393a1c674250f7bd262ee5dbc30330c9f2a58..ac1b57efaebbef7da1bb38b587146eda
    } else if (base_id == EVP_PKEY_EC) {
      EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get());
      const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);
-@@ -5050,8 +5050,8 @@ static AllocatedBuffer ConvertSignatureToP1363(Environment* env,
+@@ -4510,8 +4510,8 @@ static AllocatedBuffer ConvertSignatureToP1363(Environment* env,
    AllocatedBuffer buf = env->AllocateManaged(2 * n);
    unsigned char* data = reinterpret_cast<unsigned char*>(buf.data());
  

+ 0 - 23
patches/node/fix_use_hex_not_decimal_for_clarity.patch

@@ -1,23 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-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..b3ff343508be3b791e4aac827a18b3bbf64868c3 100644
---- a/src/module_wrap.cc
-+++ b/src/module_wrap.cc
-@@ -923,7 +923,7 @@ bool IsArrayIndex(Environment* env, Local<Value> 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<URL> ResolveExportsTarget(Environment* env,

+ 2 - 2
patches/node/fixme_comment_trace_event_macro.patch

@@ -7,10 +7,10 @@ This broke the build at some point. Does it still? We should probably remove
 this patch and find out!
 
 diff --git a/src/node_internals.h b/src/node_internals.h
-index c5b4a084e85b48d5e2121a1ebcfd0c4e4b081852..b94f31f86ba1597a9d87e5beb70fccc4fe3a7aae 100644
+index 97d78b4bacdbc64e03ed8eedae0995459e3cbc16..0279a4a8274f408049aae5464a7f4559ebe48110 100644
 --- a/src/node_internals.h
 +++ b/src/node_internals.h
-@@ -369,10 +369,11 @@ class TraceEventScope {
+@@ -371,10 +371,11 @@ class TraceEventScope {
    TraceEventScope(const char* category,
                    const char* name,
                    void* id) : category_(category), name_(name), id_(id) {

+ 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 355986b981a3811bcc835cf5dabcb720d2d5ee45..4dc268bc59a51e9645b2f69294d28fc11b29b364 100644
+index 5e3fd6590332eceafad3ecf51f5f1fa84e2e50a2..a5acf1a199146e359790acd474a93d340b7738ce 100644
 --- a/src/api/callback.cc
 +++ b/src/api/callback.cc
 @@ -111,12 +111,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 5300f6e6f6724de2bbfe42270a39f9123a3fd071..237b507df13497297ea00b7c2e0060333c3595c0 100644
+index ad82a7ab05e253a5e93a61bcaf4066cdb29017ea..d66e8dfce3dd34ecfd6aa67dfacf2282a2de893e 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -138,6 +138,8 @@ function enrichCJSError(err) {
+@@ -141,6 +141,8 @@ function enrichCJSError(err) {
  }
  
  function stat(filename) {

+ 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 ed433e1b8744ea204ddc3d343f776cb3d77dd05f..b83788989198cea230ac2eed10953416d956202c 100644
+index 734dffa343a52208a9c90c5ff7e8a43f65ad0d7f..92bc9e738f508d66948b71c4967a5c3d2b0dca6c 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1275,8 +1275,8 @@ Module._initPaths = function() {
+@@ -1273,8 +1273,8 @@ Module._initPaths = function() {
  
    modulePaths = paths;
  

+ 1 - 1
patches/node/override_existing_v8_reallocate.patch

@@ -9,7 +9,7 @@ be overridden. This patch can be removed once the relevant version of V8
 makes its way into Node.js
 
 diff --git a/src/node_internals.h b/src/node_internals.h
-index b94f31f86ba1597a9d87e5beb70fccc4fe3a7aae..fb155265bdc31fd443065d33c0b4d7d5f373a643 100644
+index 0279a4a8274f408049aae5464a7f4559ebe48110..e5d5a6497de3386c7aa70efc1f202f79d9f7567f 100644
 --- a/src/node_internals.h
 +++ b/src/node_internals.h
 @@ -115,7 +115,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {

+ 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 b83788989198cea230ac2eed10953416d956202c..5300f6e6f6724de2bbfe42270a39f9123a3fd071 100644
+index 92bc9e738f508d66948b71c4967a5c3d2b0dca6c..ad82a7ab05e253a5e93a61bcaf4066cdb29017ea 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -101,6 +101,13 @@ const {
+@@ -104,6 +104,13 @@ const {
    CHAR_COLON
  } = require('internal/constants');
  
@@ -23,7 +23,7 @@ index b83788989198cea230ac2eed10953416d956202c..5300f6e6f6724de2bbfe42270a39f912
  const isWindows = process.platform === 'win32';
  
  const relativeResolveCache = ObjectCreate(null);
-@@ -1153,10 +1160,12 @@ Module.prototype._compile = function(content, filename) {
+@@ -1151,10 +1158,12 @@ Module.prototype._compile = function(content, filename) {
    if (requireDepth === 0) statCache = new Map();
    if (inspectorWrapper) {
      result = inspectorWrapper(compiledWrapper, thisValue, exports,

+ 3 - 3
patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch

@@ -22,7 +22,7 @@ index bb9a2b177c4304496dab1f1beaedc1ae9d9f55d9..36d06759aac57b1aa813b52c94e2168b
  process.config = JSONParse(internalBinding('native_module').config);
  
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index 237b507df13497297ea00b7c2e0060333c3595c0..22912e7c89b4cba78315269c3e009bfca1ccec27 100644
+index d66e8dfce3dd34ecfd6aa67dfacf2282a2de893e..8bb5dae46966541884dbad5bb9c3a3f790c56358 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
 @@ -54,10 +54,7 @@ const assert = require('internal/assert');
@@ -37,7 +37,7 @@ index 237b507df13497297ea00b7c2e0060333c3595c0..22912e7c89b4cba78315269c3e009bfc
  const { safeGetenv } = internalBinding('credentials');
  const {
    makeRequireFunction,
-@@ -138,14 +135,12 @@ function enrichCJSError(err) {
+@@ -141,14 +138,12 @@ function enrichCJSError(err) {
  }
  
  function stat(filename) {
@@ -53,7 +53,7 @@ index 237b507df13497297ea00b7c2e0060333c3595c0..22912e7c89b4cba78315269c3e009bfc
    if (statCache !== null) statCache.set(filename, result);
    return result;
  }
-@@ -251,7 +246,7 @@ function readPackage(requestPath) {
+@@ -254,7 +249,7 @@ function readPackage(requestPath) {
    const existing = packageJsonCache.get(jsonPath);
    if (existing !== undefined) return existing;
  

+ 2 - 2
patches/node/refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch

@@ -7,7 +7,7 @@ Subject: refactor: TransferrableModule is deprecated, use CompiledWasmModule
 This will be upstreamed to nodejs/node
 
 diff --git a/src/node_messaging.cc b/src/node_messaging.cc
-index b0e7d15a8c40a6552969049c0c84628df3d54c8c..413cec135fcf00a9ed5ce4982484896b9c5272ff 100644
+index f55cb7ed9bd08cf85a8642e2fba6dbf9f6710337..39bcc1236ff7c6d90e268f7c55fa623cb5dfb956 100644
 --- a/src/node_messaging.cc
 +++ b/src/node_messaging.cc
 @@ -58,7 +58,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
@@ -56,7 +56,7 @@ index b0e7d15a8c40a6552969049c0c84628df3d54c8c..413cec135fcf00a9ed5ce4982484896b
  
    void Finish() {
 diff --git a/src/node_messaging.h b/src/node_messaging.h
-index 054521b0563c4256f65d6f01eeeb108e3a515d86..53c766da554452c635a3bdfb38b75c0492bbfb5e 100644
+index d64bf23e086d0596e745d838020740848b399859..468e276f83df05bcc570449f94d65a00a22dcd5d 100644
 --- a/src/node_messaging.h
 +++ b/src/node_messaging.h
 @@ -58,7 +58,7 @@ class Message : public MemoryRetainer {

+ 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 e33a5d11ddbf900b26c1baa62f65bae49cdbaa24..3c2393a1c674250f7bd262ee5dbc30330c9f2a58 100644
+index 41eb04caffd4c1faaecd0f8a2cbe93016475bfe1..5e00468aac8b9f9c5ef7ea2f1e3b62991bfde255 100644
 --- a/src/node_crypto.cc
 +++ b/src/node_crypto.cc
-@@ -5508,18 +5508,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
+@@ -4969,18 +4969,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
        return false;
    }
  

+ 1 - 0
script/node-disabled-tests.json

@@ -211,6 +211,7 @@
   "report/test-report-signal",
   "report/test-report-uncaught-exception",
   "report/test-report-writereport",
+  "report/test-report-worker",
   "sequential/test-child-process-execsync",
   "sequential/test-cpu-prof-default",
   "sequential/test-cpu-prof-dir-absolute",

+ 4 - 4
shell/browser/node_debugger.cc

@@ -30,10 +30,10 @@ void NodeDebugger::Start() {
   // DebugOptions will already have been set by ProcessGlobalArgs,
   // so just pull the ones from there to pass to the InspectorAgent
   const auto debug_options = env_->options()->debug_options();
-  if (inspector->Start(
-          "" /* path */, debug_options,
-          std::make_shared<node::HostPort>(debug_options.host_port),
-          true /* is_main */))
+  if (inspector->Start("" /* path */, debug_options,
+                       std::make_shared<node::ExclusiveAccess<node::HostPort>>(
+                           debug_options.host_port),
+                       true /* is_main */))
     DCHECK(env_->inspector_agent()->IsListening());
 }