Browse Source

build: move our node fork to our patch system (#19292)

This points our node repo at upstream (nodejs/node) and uses the base node tag as the target ref.  We then use our existing patch system and patch files to apply our changes on top of node.  This unifies how we patch upstream repos and makes our node patches easier to reason, view, understand and most importantly reduce.
Samuel Attard 5 years ago
parent
commit
46c0859c49
47 changed files with 4525 additions and 3 deletions
  1. 3 2
      DEPS
  2. 3 1
      patches/common/config.json
  3. 44 0
      patches/common/node/.patches
  4. 848 0
      patches/common/node/2019-04-23_version_12_0_0_current.patch
  5. 48 0
      patches/common/node/allow_embedder_to_reuse_the_per_process_nativemoduleloader.patch
  6. 1655 0
      patches/common/node/build_add_gn_build_files.patch
  7. 159 0
      patches/common/node/build_allow_embedders_to_override_the_node_module_version_define.patch
  8. 23 0
      patches/common/node/call_process_log_from_fallback_stream_on_windows.patch
  9. 62 0
      patches/common/node/chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch
  10. 49 0
      patches/common/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
  11. 19 0
      patches/common/node/export_environment_knodecontexttagptr.patch
  12. 22 0
      patches/common/node/export_nativemodule.patch
  13. 23 0
      patches/common/node/expose_get_builtin_module_function.patch
  14. 139 0
      patches/common/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch
  15. 19 0
      patches/common/node/feat_add_new_built_with_electron_variable_to_config_gypi.patch
  16. 27 0
      patches/common/node/feat_add_original-fs_module.patch
  17. 59 0
      patches/common/node/feat_add_uv_loop_watcher_queue_code.patch
  18. 42 0
      patches/common/node/feat_initialize_asar_support.patch
  19. 36 0
      patches/common/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
  20. 66 0
      patches/common/node/fix_build_and_expose_inspector_agent.patch
  21. 54 0
      patches/common/node/fix_do_not_define_debugoptions_s_constructors_in_header.patch
  22. 21 0
      patches/common/node/fix_don_t_create_console_window_when_creating_process.patch
  23. 56 0
      patches/common/node/fix_export_debugoptions.patch
  24. 31 0
      patches/common/node/fix_export_libuv_symbols_73.patch
  25. 49 0
      patches/common/node/fix_export_node_abort_and_assert.patch
  26. 20 0
      patches/common/node/fix_expose_internalcallbackscope.patch
  27. 20 0
      patches/common/node/fix_expose_traceeventhelper.patch
  28. 42 0
      patches/common/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
  29. 95 0
      patches/common/node/fix_key_gen_apis_are_not_available_in_boringssl.patch
  30. 23 0
      patches/common/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch
  31. 48 0
      patches/common/node/fix_use_bssl_bn_bn2bin_padded_for_ossl_s_bn_bn2binpad.patch
  32. 21 0
      patches/common/node/fix_wrong_uses_node_allocator_condition.patch
  33. 64 0
      patches/common/node/fixme_add_back_nativemoduleloader_compileandcall.patch
  34. 24 0
      patches/common/node/fixme_comment_trace_event_macro.patch
  35. 25 0
      patches/common/node/fixme_remove_async_id_assertion_check.patch
  36. 24 0
      patches/common/node/fixme_use_redefined_version_of_internalmodulestat.patch
  37. 213 0
      patches/common/node/fsevents_fix_file_event_reporting.patch
  38. 91 0
      patches/common/node/http2_fix_tracking_received_data_for_maxsessionmemory.patch
  39. 22 0
      patches/common/node/inherit_electron_crashpad_pipe_name_in_child_process.patch
  40. 26 0
      patches/common/node/make_module_globalpaths_a_reference.patch
  41. 40 0
      patches/common/node/pass_all_globals_through_require.patch
  42. 61 0
      patches/common/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch
  43. 29 0
      patches/common/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch
  44. 20 0
      patches/common/node/src_disable_node_use_v8_platform_in_node_options.patch
  45. 19 0
      patches/common/node/src_only_run_preloadmodules_if_the_preload_array_is_not_empty.patch
  46. 21 0
      patches/common/node/src_read_break_node_first_line_from_the_inspect_options.patch
  47. 20 0
      patches/common/node/src_use_check_false_in_switch_default_case.patch

+ 3 - 2
DEPS

@@ -12,7 +12,7 @@ vars = {
   'chromium_version':
     '73.0.3683.121',
   'node_version':
-    '0a300f60bce0c8f0cb3d846fcb0e1f55f26013ee',
+    '666c67e078bddc32f25409f4a929c1e9b5f47373',
 
   'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
   'pyyaml_version': '3.12',
@@ -21,6 +21,7 @@ vars = {
   'boto_git': 'https://github.com/boto',
   'chromium_git': 'https://chromium.googlesource.com',
   'electron_git': 'https://github.com/electron',
+  'nodejs_git': 'https://github.com/nodejs',
   'requests_git': 'https://github.com/kennethreitz',
   'yaml_git': 'https://github.com/yaml',
 
@@ -64,7 +65,7 @@ deps = {
     'condition': 'checkout_chromium',
   },
   'src/third_party/electron_node': {
-    'url': (Var("electron_git")) + '/node.git@' + (Var("node_version")),
+    'url': (Var("nodejs_git")) + '/node.git@' + (Var("node_version")),
     'condition': 'checkout_node',
   },
   'src/electron/vendor/pyyaml': {

+ 3 - 1
patches/common/config.json

@@ -5,5 +5,7 @@
 
   "src/electron/patches/common/ffmpeg": "src/third_party/ffmpeg",
 
-  "src/electron/patches/common/v8":  "src/v8"
+  "src/electron/patches/common/v8":  "src/v8",
+
+  "src/electron/patches/common/node":  "src/third_party/electron_node"
 }

+ 44 - 0
patches/common/node/.patches

@@ -0,0 +1,44 @@
+2019-04-23_version_12_0_0_current.patch
+make_module_globalpaths_a_reference.patch
+fix_don_t_create_console_window_when_creating_process.patch
+refactor_alter_child_process_fork_to_use_execute_script_with.patch
+feat_add_uv_loop_watcher_queue_code.patch
+feat_initialize_asar_support.patch
+export_nativemodule.patch
+expose_get_builtin_module_function.patch
+fix_expose_traceeventhelper.patch
+fix_build_and_expose_inspector_agent.patch
+fix_expose_internalcallbackscope.patch
+build_add_gn_build_files.patch
+allow_embedder_to_reuse_the_per_process_nativemoduleloader.patch
+fix_export_debugoptions.patch
+fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+feat_add_new_built_with_electron_variable_to_config_gypi.patch
+feat_add_flags_for_low-level_hooks_and_exceptions.patch
+export_environment_knodecontexttagptr.patch
+fix_export_libuv_symbols_73.patch
+fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
+fix_use_bssl_bn_bn2bin_padded_for_ossl_s_bn_bn2binpad.patch
+pass_all_globals_through_require.patch
+call_process_log_from_fallback_stream_on_windows.patch
+fixme_use_redefined_version_of_internalmodulestat.patch
+fixme_remove_async_id_assertion_check.patch
+src_use_check_false_in_switch_default_case.patch
+fixme_comment_trace_event_macro.patch
+fixme_add_back_nativemoduleloader_compileandcall.patch
+fix_export_node_abort_and_assert.patch
+fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch
+fix_key_gen_apis_are_not_available_in_boringssl.patch
+fix_do_not_define_debugoptions_s_constructors_in_header.patch
+src_disable_node_use_v8_platform_in_node_options.patch
+fix_wrong_uses_node_allocator_condition.patch
+feat_add_original-fs_module.patch
+build_allow_embedders_to_override_the_node_module_version_define.patch
+refactor_allow_embedder_overriding_of_internal_fs_calls.patch
+chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch
+fsevents_fix_file_event_reporting.patch
+src_only_run_preloadmodules_if_the_preload_array_is_not_empty.patch
+src_read_break_node_first_line_from_the_inspect_options.patch
+chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
+inherit_electron_crashpad_pipe_name_in_child_process.patch
+http2_fix_tracking_received_data_for_maxsessionmemory.patch

+ 848 - 0
patches/common/node/2019-04-23_version_12_0_0_current.patch

@@ -0,0 +1,848 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Beth Griggs <[email protected]>
+Date: Fri, 22 Mar 2019 13:19:46 +0000
+Subject: 2019-04-23, Version 12.0.0 (Current)
+
+Notable changes:
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+index 99ca2329cae3f8a5391e0aa482516120ad5a401f..2c98c771ba54ae56a505eac54277079e150bb646 100644
+--- a/CHANGELOG.md
++++ b/CHANGELOG.md
+@@ -21,6 +21,7 @@ release.
+ <!--lint disable maximum-line-length-->
+ <table>
+ <tr>
++  <th title="Current"><a href="doc/changelogs/CHANGELOG_V12.md">12</a><sup>Current</sup></th>
+   <th title="Current"><a href="doc/changelogs/CHANGELOG_V11.md">11</a><sup>Current</sup></th>
+   <th title="LTS Until 2021-04"><a href="doc/changelogs/CHANGELOG_V10.md">10</a><sup>LTS</sup></th>
+   <th title="LTS Until 2019-12"><a href="doc/changelogs/CHANGELOG_V8.md">8</a><sup>LTS</sup></th>
+@@ -28,6 +29,9 @@ release.
+ </tr>
+ <tr>
+     <td valign="top">
++<b><a href="doc/changelogs/CHANGELOG_V12.md#12.0.0">12.0.0</a></b><br/>
++    </td>
++    <td valign="top">
+ <b><a href="doc/changelogs/CHANGELOG_V11.md#11.13.0">11.13.0</a></b><br/>
+ <a href="doc/changelogs/CHANGELOG_V11.md#11.12.0">11.12.0</a><br/>
+ <a href="doc/changelogs/CHANGELOG_V11.md#11.11.0">11.11.0</a><br/>
+diff --git a/doc/api/assert.md b/doc/api/assert.md
+index 67bc9afbabccbe8d41e7192b9e0b23d0caa6d342..9028d21f0d9df3dd201bba44b59af457b176e9c8 100644
+--- a/doc/api/assert.md
++++ b/doc/api/assert.md
+@@ -163,7 +163,7 @@ An alias of [`assert.ok()`][].
+ <!-- YAML
+ added: v0.1.21
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25008
+     description: The type tags are now properly compared and there are a couple
+                  minor comparison adjustments to make the check less surprising.
+diff --git a/doc/api/cli.md b/doc/api/cli.md
+index ad7b65e90a827e2018a9e38cb77926e8212fa3f3..c04c81319a070606fa4ec878da58c8bd80ba359e 100644
+--- a/doc/api/cli.md
++++ b/doc/api/cli.md
+@@ -479,7 +479,7 @@ with crypto support (default).
+ 
+ ### `--tls-max-v1.2`
+ <!-- YAML
+-added: REPLACEME
++added: v12.0.0
+ -->
+ 
+ Set [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.2'. Use to disable support for
+@@ -487,7 +487,7 @@ TLSv1.3.
+ 
+ ### `--tls-max-v1.3`
+ <!-- YAML
+-added: REPLACEME
++added: v12.0.0
+ -->
+ 
+ Set default [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.3'. Use to enable support
+@@ -495,7 +495,7 @@ for TLSv1.3.
+ 
+ ### `--tls-min-v1.0`
+ <!-- YAML
+-added: REPLACEME
++added: v12.0.0
+ -->
+ 
+ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1'. Use for compatibility with
+@@ -503,7 +503,7 @@ old TLS clients or servers.
+ 
+ ### `--tls-min-v1.1`
+ <!-- YAML
+-added: REPLACEME
++added: v12.0.0
+ -->
+ 
+ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.1'. Use for compatibility
+@@ -511,7 +511,7 @@ with old TLS clients or servers.
+ 
+ ### `--tls-min-v1.3`
+ <!-- YAML
+-added: REPLACEME
++added: v12.0.0
+ -->
+ 
+ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
+diff --git a/doc/api/crypto.md b/doc/api/crypto.md
+index 480930898eced00dab128ff66dcb59e5b5113640..b096a01a6321f7476f0f841cd0cdc88bf54ea1ad 100644
+--- a/doc/api/crypto.md
++++ b/doc/api/crypto.md
+@@ -1975,7 +1975,7 @@ a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
+ <!-- YAML
+ added: v10.12.0
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26554
+     description: Add ability to generate Ed25519 and Ed448 key pairs.
+   - version: v11.6.0
+diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md
+index eaf946a777dc528793980b2b3aa3d4ab88b6da35..2a62663d8fb778da13c40856c5de4d81e3cd716e 100644
+--- a/doc/api/deprecations.md
++++ b/doc/api/deprecations.md
+@@ -160,7 +160,7 @@ outside `node_modules` in order to better target developers, rather than users.
+ ### DEP0006: child\_process options.customFds
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25279
+     description: End-of-Life.
+   - version:
+@@ -513,7 +513,7 @@ The `os.tmpDir()` API is deprecated. Please use [`os.tmpdir()`][] instead.
+ ### DEP0023: os.getNetworkInterfaces()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25280
+     description: End-of-Life.
+   - version:
+@@ -569,7 +569,7 @@ The `sys` module is deprecated. Please use the [`util`][] module instead.
+ ### DEP0026: util.print()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25377
+     description: End-of-Life.
+   - version:
+@@ -590,7 +590,7 @@ Type: End-of-Life
+ ### DEP0027: util.puts()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25377
+     description: End-of-Life.
+   - version:
+@@ -611,7 +611,7 @@ Type: End-of-Life
+ ### DEP0028: util.debug()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25377
+     description: End-of-Life.
+   - version:
+@@ -632,7 +632,7 @@ Type: End-of-Life
+ ### DEP0029: util.error()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25377
+     description: End-of-Life.
+   - version:
+@@ -1279,7 +1279,7 @@ changes:
+   - version: v8.0.0
+     pr-url: https://github.com/nodejs/node/pull/10970
+     description: Runtime deprecation.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25828
+     description: End-of-Life.
+ -->
+@@ -1362,7 +1362,7 @@ removed. Please use `sloppy` instead.
+ ### DEP0066: outgoingMessage.\_headers, outgoingMessage.\_headerNames
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/24167
+     description: Runtime deprecation.
+   - version: v8.0.0
+@@ -1688,7 +1688,7 @@ the client and is now unsupported. Use the `ciphers` parameter instead.
+ ### DEP0084: requiring bundled internal dependencies
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25138
+     description: This functionality has been removed.
+   - version: v10.0.0
+@@ -1905,7 +1905,7 @@ should start using the `async_context` variant of `MakeCallback` or
+ ### DEP0098: AsyncHooks Embedder AsyncResource.emitBefore and AsyncResource.emitAfter APIs
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26530
+     description: End-of-Life
+   - version:
+@@ -2168,7 +2168,7 @@ accessed outside of Node.js core: `Socket.prototype._handle`,
+ ### DEP0113: Cipher.setAuthTag(), Decipher.getAuthTag()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26249
+     description: End-of-Life.
+   - version: v11.0.0
+@@ -2185,7 +2185,7 @@ were never documented and would throw when called.
+ ### DEP0114: crypto._toBuf()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25338
+     description: End-of-Life.
+   - version: v11.0.0
+@@ -2284,7 +2284,7 @@ Type: Documentation-only (supports [`--pending-deprecation`][])
+ ### DEP0120: Windows Performance Counter Support
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/24862
+     description: End-of-Life.
+   - version: v11.0.0
+@@ -2304,7 +2304,7 @@ undocumented `COUNTER_NET_SERVER_CONNECTION()`,
+ ### DEP0121: net._setSimultaneousAccepts()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23760
+     description: Runtime deprecation.
+ -->
+@@ -2319,7 +2319,7 @@ https://github.com/nodejs/node/issues/18391
+ ### DEP0122: tls Server.prototype.setOptions()
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23820
+     description: Runtime deprecation.
+ -->
+@@ -2332,7 +2332,7 @@ Please use `Server.prototype.setSecureContext()` instead.
+ ### DEP0123: setting the TLS ServerName to an IP address
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23329
+     description: Runtime deprecation.
+ -->
+@@ -2346,7 +2346,7 @@ Setting the TLS ServerName to an IP address is not permitted by
+ ### DEP0124: using REPLServer.rli
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26260
+     description: Runtime deprecation.
+ -->
+@@ -2359,7 +2359,7 @@ This property is a reference to the instance itself.
+ ### DEP0125: require('\_stream\_wrap')
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26245
+     description: Runtime deprecation.
+ -->
+diff --git a/doc/api/errors.md b/doc/api/errors.md
+index 2ad0bead8ec0bbbb1e55d7eae4dc8d09831f1ffd..e1a60a3a38ac790cf12d4c97d3f449b3d1dc7f43 100644
+--- a/doc/api/errors.md
++++ b/doc/api/errors.md
+@@ -1998,7 +1998,7 @@ an `Error` with this code will be emitted.
+ ### MODULE_NOT_FOUND
+ <!-- YAML
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25690
+     description: Added `requireStack` property.
+ -->
+diff --git a/doc/api/fs.md b/doc/api/fs.md
+index c96b2cf5c5f8f64746d4d364d3a9bc9dd079e2ea..0ce63f98ce25485a17929123d0e5331df4af8423 100644
+--- a/doc/api/fs.md
++++ b/doc/api/fs.md
+@@ -3043,7 +3043,7 @@ changes:
+     description: The `target` and `path` parameters can be WHATWG `URL` objects
+                  using `file:` protocol. Support is currently still
+                  *experimental*.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23724
+     description: If the `type` argument is left undefined, Node will autodetect
+                  `target` type and automatically select `dir` or `file`
+@@ -3081,7 +3081,7 @@ changes:
+     description: The `target` and `path` parameters can be WHATWG `URL` objects
+                  using `file:` protocol. Support is currently still
+                  *experimental*.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23724
+     description: If the `type` argument is left undefined, Node will autodetect
+                  `target` type and automatically select `dir` or `file`
+diff --git a/doc/api/http.md b/doc/api/http.md
+index 927e64554ed276d80f6d1dc8aa436763af279dab..ccd5e4b0bd4b308c648ea0cf0ccf2cfe90a44ccd 100644
+--- a/doc/api/http.md
++++ b/doc/api/http.md
+@@ -838,7 +838,7 @@ changes:
+     description: The `rawPacket` is the current buffer that just parsed. Adding
+                  this buffer to the error object of `'clientError'` event is to
+                  make it possible that developers can log the broken packet.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/25605
+     description: The default behavior will return a 431 Request Header
+                  Fields Too Large if a HPE_HEADER_OVERFLOW error occurs.
+diff --git a/doc/api/tls.md b/doc/api/tls.md
+index 65897ab3151331779a42ca95e3901b2fff8e7ea2..6a834c65ff30126c67c693c91e0cc190467e4ba7 100644
+--- a/doc/api/tls.md
++++ b/doc/api/tls.md
+@@ -753,7 +753,7 @@ socket has been destroyed, `null` will be returned.
+ <!-- YAML
+ added: v0.11.4
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26625
+     description: Return the minimum cipher version, instead of a fixed string
+       (`'TLSv1/SSLv3'`).
+@@ -1264,7 +1264,7 @@ argument.
+ <!-- YAML
+ added: v0.11.13
+ changes:
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/26209
+     description: TLSv1.3 support added.
+   - version: v11.5.0
+diff --git a/doc/api/util.md b/doc/api/util.md
+index beb79ae0f85616154e1fa4e0d1681eaa1cb4da36..75015a4b1167baa51745655f3f238f3c0bd3b1b8 100644
+--- a/doc/api/util.md
++++ b/doc/api/util.md
+@@ -187,11 +187,11 @@ changes:
+     pr-url: https://github.com/nodejs/node/pull/23708
+     description: The `%d`, `%f` and `%i` specifiers now support Symbols
+                  properly.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23162
+     description: The `format` argument is now only taken as such if it actually
+                  contains format specifiers.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/23162
+     description: If the `format` argument is not a format string, the output
+                  string's formatting is no longer dependent on the type of the
+@@ -391,7 +391,7 @@ changes:
+   - version: v11.11.0
+     pr-url: https://github.com/nodejs/node/pull/26269
+     description: The `compact` option accepts numbers for a new output mode.
+-  - version: REPLACEME
++  - version: v12.0.0
+     pr-url: https://github.com/nodejs/node/pull/24971
+     description: Internal properties no longer appear in the context argument
+                  of a custom inspection function.
+diff --git a/doc/changelogs/CHANGELOG_ARCHIVE.md b/doc/changelogs/CHANGELOG_ARCHIVE.md
+index 5ee962a21564d2648f88112b496a0cddb65dac2b..6bd1bb5ef68fbc1bc3022f343dbeee354fa63cbe 100644
+--- a/doc/changelogs/CHANGELOG_ARCHIVE.md
++++ b/doc/changelogs/CHANGELOG_ARCHIVE.md
+@@ -154,6 +154,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_IOJS.md b/doc/changelogs/CHANGELOG_IOJS.md
+index 1ed2758fdca3c98d921a463dd891cc0d2343c9d1..b8e346b76bad55d84ae06c40a2b58674f8563368 100644
+--- a/doc/changelogs/CHANGELOG_IOJS.md
++++ b/doc/changelogs/CHANGELOG_IOJS.md
+@@ -63,6 +63,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V010.md b/doc/changelogs/CHANGELOG_V010.md
+index c05d99f71d505026f739965bfab5061dbeb31efa..b6c1c1cc80284ab433d30c4cfee8fc638c850085 100644
+--- a/doc/changelogs/CHANGELOG_V010.md
++++ b/doc/changelogs/CHANGELOG_V010.md
+@@ -65,6 +65,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V012.md b/doc/changelogs/CHANGELOG_V012.md
+index 7cf0e4feb5cbd1e87d45bc4cf7ce71d350913039..9ec4f6876cd371a9e11132bd3adf6c3807711b34 100644
+--- a/doc/changelogs/CHANGELOG_V012.md
++++ b/doc/changelogs/CHANGELOG_V012.md
+@@ -33,6 +33,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V10.md b/doc/changelogs/CHANGELOG_V10.md
+index 445f43734a8df40f31530660c5088e2e6a8b2ebd..7ef825f95b6245b0c912b7d93c479695f5be9ae1 100644
+--- a/doc/changelogs/CHANGELOG_V10.md
++++ b/doc/changelogs/CHANGELOG_V10.md
+@@ -40,6 +40,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [9.x](CHANGELOG_V9.md)
+   * [8.x](CHANGELOG_V8.md)
+diff --git a/doc/changelogs/CHANGELOG_V11.md b/doc/changelogs/CHANGELOG_V11.md
+index 93915b4a5c3c27ef6d0ca7162006daeb269c0dfc..17787df9302f6dc147f5289754dcdff8f6848e8f 100644
+--- a/doc/changelogs/CHANGELOG_V11.md
++++ b/doc/changelogs/CHANGELOG_V11.md
+@@ -29,6 +29,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+   * [8.x](CHANGELOG_V8.md)
+diff --git a/doc/changelogs/CHANGELOG_V12.md b/doc/changelogs/CHANGELOG_V12.md
+new file mode 100644
+index 0000000000000000000000000000000000000000..ee47efa3ad224af0d50179be36a1662a99ed5bdd
+--- /dev/null
++++ b/doc/changelogs/CHANGELOG_V12.md
+@@ -0,0 +1,317 @@
++# Node.js 12 ChangeLog
++
++<!--lint disable prohibited-strings-->
++<!--lint disable maximum-line-length-->
++
++<table>
++<tr>
++<th>Current</th>
++</tr>
++<tr>
++<td>
++<a href="#12.0.0">12.0.0</a><br/>
++</td>
++</tr>
++</table>
++
++* Other Versions
++  * [11.x](CHANGELOG_V11.md)
++  * [10.x](CHANGELOG_V10.md)
++  * [9.x](CHANGELOG_V9.md)
++  * [8.x](CHANGELOG_V8.md)
++  * [7.x](CHANGELOG_V7.md)
++  * [6.x](CHANGELOG_V6.md)
++  * [5.x](CHANGELOG_V5.md)
++  * [4.x](CHANGELOG_V4.md)
++  * [0.12.x](CHANGELOG_V012.md)
++  * [0.10.x](CHANGELOG_V010.md)
++  * [io.js](CHANGELOG_IOJS.md)
++  * [Archive](CHANGELOG_ARCHIVE.md)
++
++<a id="11.0.0"></a>
++## 2019-04-23, Version 12.0.0 (Current), @BethGriggs
++
++### Notable Changes
++
++* **assert**:
++    * improve performance to instantiate errors (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++    * validate required arguments (Ruben Bridgewater) [#26641](https://github.com/nodejs/node/pull/26641)
++    * adjust loose assertions (Ruben Bridgewater) [#25008](https://github.com/nodejs/node/pull/25008)
++* **async_hooks**:
++    * remove deprecated emitBefore and emitAfter (Matteo Collina) [#26530](https://github.com/nodejs/node/pull/26530)
++    * remove promise object from resource (Andreas Madsen) [#23443](https://github.com/nodejs/node/pull/23443)
++* **bootstrap**: make Buffer and process non-enumerable (Ruben Bridgewater) [#24874](https://github.com/nodejs/node/pull/24874)
++* **buffer**:
++    * harden SlowBuffer creation (ZYSzys) [#26272](https://github.com/nodejs/node/pull/26272)
++    * harden validation of buffer allocation size (ZYSzys) [#26162](https://github.com/nodejs/node/pull/26162)
++    * do proper error propagation in addon methods (Anna Henningsen) [#23939](https://github.com/nodejs/node/pull/23939)
++* **console**: don't use ANSI escape codes when TERM=dumb (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++* **crypto**:
++    * decode missing passphrase errors (Tobias Nießen) [#25208](https://github.com/nodejs/node/pull/25208)
++    * move DEP0113 to End-of-Life (Tobias Nießen) [#26249](https://github.com/nodejs/node/pull/26249)
++    * remove deprecated crypto.\_toBuf (Tobias Nießen) [#25338](https://github.com/nodejs/node/pull/25338)
++    * set `DEFAULT\_ENCODING` property to non-enumerable (Antoine du Hamel) [#23222](https://github.com/nodejs/node/pull/23222)
++* **deps**:
++    * silence irrelevant V8 warning (Michaël Zasso) [#26685](https://github.com/nodejs/node/pull/26685)
++    * update postmortem metadata generation script (cjihrig) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: un-cherry-pick bd019bd (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 6 commits (Michaël Zasso) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick d82c9af (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick e5f01ba (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick d5f08e4 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 6b09d21 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick f0bb5d2 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 5b0510d (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 91f0cd0 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 392316d (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * V8: cherry-pick 2f79d68 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++    * sync V8 gypfiles with 7.4 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++    * update V8 to 7.4.288.13 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++    * bump minimum icu version to 63 (Ujjwal Sharma) [#25852](https://github.com/nodejs/node/pull/25852)
++    * silence irrelevant V8 warnings (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * V8: cherry-pick 7803fa6 (Jon Kunkee) [#25852](https://github.com/nodejs/node/pull/25852)
++    * V8: cherry-pick 58cefed (Jon Kunkee) [#25852](https://github.com/nodejs/node/pull/25852)
++    * cherry-pick d3308d0 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * V8: cherry-pick 74571c8 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * cherry-pick fc0ddf5 from upstream V8 (Anna Henningsen) [#25852](https://github.com/nodejs/node/pull/25852)
++    * sync V8 gypfiles with 7.3 (Ujjwal Sharma) [#25852](https://github.com/nodejs/node/pull/25852)
++    * sync V8 gypfiles with 7.2 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * update V8 to 7.3.492.25 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * add s390 asm rules for OpenSSL-1.1.1 (Shigeki Ohtsu) [#19794](https://github.com/nodejs/node/pull/19794)
++    * sync V8 gypfiles with 7.1 (Refael Ackermann) [#23423](https://github.com/nodejs/node/pull/23423)
++    * update V8 to 7.1.302.28 (Michaël Zasso) [#23423](https://github.com/nodejs/node/pull/23423)
++* **doc**:
++    * update behaviour of fs.writeFile (Sakthipriyan Vairamani (thefourtheye)) [#25080](https://github.com/nodejs/node/pull/25080)
++    * add internal functionality details of util.inherits (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++* **errors**: update error name (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* **fs**:
++    * use proper .destroy() implementation for SyncWriteStream (Matteo Collina) [#26690](https://github.com/nodejs/node/pull/26690)
++    * improve mode validation (Ruben Bridgewater) [#26575](https://github.com/nodejs/node/pull/26575)
++    * harden validation of start option in createWriteStream (ZYSzys) [#25579](https://github.com/nodejs/node/pull/25579)
++    * make writeFile consistent with readFile wrt fd (Sakthipriyan Vairamani (thefourtheye)) [#23709](https://github.com/nodejs/node/pull/23709)
++* **http**:
++    * validate timeout in ClientRequest() (cjihrig) [#26214](https://github.com/nodejs/node/pull/26214)
++    * return HTTP 431 on HPE\_HEADER\_OVERFLOW error (Albert Still) [#25605](https://github.com/nodejs/node/pull/25605)
++    * switch default parser to llhttp (Anna Henningsen) [#24870](https://github.com/nodejs/node/pull/24870)
++    * change DEP0066 to a runtime deprecation (Morgan Roderick) [#24167](https://github.com/nodejs/node/pull/24167)
++    * else case is not reachable (szabolcsit) [#24176](https://github.com/nodejs/node/pull/24176)
++* **lib**:
++    * validate Error.captureStackTrace() calls (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++    * refactor Error.captureStackTrace() usage (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++    * move DTRACE\_\* probes out of global scope (James M Snell) [#26541](https://github.com/nodejs/node/pull/26541)
++    * deprecate \_stream\_wrap (Sam Roberts) [#26245](https://github.com/nodejs/node/pull/26245)
++    * don't use `util.inspect()` internals (Ruben Bridgewater) [#24971](https://github.com/nodejs/node/pull/24971)
++    * improve error message for MODULE\_NOT\_FOUND (Ali Ijaz Sheikh) [#25690](https://github.com/nodejs/node/pull/25690)
++    * requireStack property for MODULE\_NOT\_FOUND (Ali Ijaz Sheikh) [#25690](https://github.com/nodejs/node/pull/25690)
++    * move DEP0029 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++    * move DEP0028 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++    * move DEP0027 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++    * move DEP0026 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++    * move DEP0023 to end of life (cjihrig) [#25280](https://github.com/nodejs/node/pull/25280)
++    * move DEP0006 to end of life (cjihrig) [#25279](https://github.com/nodejs/node/pull/25279)
++    * remove unintended access to deps/ (Anna Henningsen) [#25138](https://github.com/nodejs/node/pull/25138)
++    * move DEP0120 to end of life (cjihrig) [#24862](https://github.com/nodejs/node/pull/24862)
++    * use ES6 class inheritance style (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++    * remove `inherits()` usage (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++* **module**: don't search in require.resolve.paths (cjihrig) [#23683](https://github.com/nodejs/node/pull/23683)
++* **n-api**: remove code from error name (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* **net**:
++    * do not manipulate potential user code (Ruben Bridgewater) [#26751](https://github.com/nodejs/node/pull/26751)
++    * emit "write after end" errors in the next tick (Ouyang Yadong) [#24457](https://github.com/nodejs/node/pull/24457)
++    * deprecate \_setSimultaneousAccepts() undocumented function (James M Snell) [#23760](https://github.com/nodejs/node/pull/23760)
++* **net,http2**: merge setTimeout code (ZYSzys) [#25084](https://github.com/nodejs/node/pull/25084)
++* **os**: implement os.type() using uv\_os\_uname() (cjihrig) [#25659](https://github.com/nodejs/node/pull/25659)
++* **process**:
++    * global.process, global.Buffer getters (Guy Bedford) [#26882](https://github.com/nodejs/node/pull/26882)
++    * move DEP0062 (node --debug) to end-of-life (Joyee Cheung) [#25828](https://github.com/nodejs/node/pull/25828)
++    * exit on --debug and --debug-brk after option parsing (Joyee Cheung) [#25828](https://github.com/nodejs/node/pull/25828)
++    * improve `--redirect-warnings` handling (Ruben Bridgewater) [#24965](https://github.com/nodejs/node/pull/24965)
++* **readline**: support TERM=dumb (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++* **repl**:
++    * fix terminal default setting (Ruben Bridgewater) [#26518](https://github.com/nodejs/node/pull/26518)
++    * check colors with .getColorDepth() (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++    * deprecate REPLServer.rli (Ruben Bridgewater) [#26260](https://github.com/nodejs/node/pull/26260)
++* **src**:
++    * update NODE\_MODULE\_VERSION to 72 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++    * remove `AddPromiseHook()` (Anna Henningsen) [#26574](https://github.com/nodejs/node/pull/26574)
++    * update NODE\_MODULE\_VERSION to 71 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++    * clean up MultiIsolatePlatform interface (Anna Henningsen) [#26384](https://github.com/nodejs/node/pull/26384)
++    * properly configure default heap limits (Ali Ijaz Sheikh) [#25576](https://github.com/nodejs/node/pull/25576)
++    * remove icuDataDir from node config (GauthamBanasandra) [#24780](https://github.com/nodejs/node/pull/24780)
++    * explicitly allow JS in ReadHostObject (Yang Guo) [#23423](https://github.com/nodejs/node/pull/23423)
++    * update postmortem constant (cjihrig) [#23423](https://github.com/nodejs/node/pull/23423)
++    * update NODE\_MODULE\_VERSION to 68 (Michaël Zasso) [#23423](https://github.com/nodejs/node/pull/23423)
++* **tls**:
++    * support TLSv1.3 (Sam Roberts) [#26209](https://github.com/nodejs/node/pull/26209)
++    * return correct version from getCipher() (Sam Roberts) [#26625](https://github.com/nodejs/node/pull/26625)
++    * check arg types of renegotiate() (Sam Roberts) [#25876](https://github.com/nodejs/node/pull/25876)
++    * add code for ERR\_TLS\_INVALID\_PROTOCOL\_METHOD (Sam Roberts) [#24729](https://github.com/nodejs/node/pull/24729)
++    * emit a warning when servername is an IP address (Rodger Combs) [#23329](https://github.com/nodejs/node/pull/23329)
++    * disable TLS v1.0 and v1.1 by default (Ben Noordhuis) [#23814](https://github.com/nodejs/node/pull/23814)
++    * remove unused arg to createSecureContext() (Sam Roberts) [#24241](https://github.com/nodejs/node/pull/24241)
++    * deprecate Server.prototype.setOptions() (cjihrig) [#23820](https://github.com/nodejs/node/pull/23820)
++    * load NODE\_EXTRA\_CA\_CERTS at startup (Ouyang Yadong) [#23354](https://github.com/nodejs/node/pull/23354)
++* **util**:
++    * only the first line of the error message (Simon Zünd) [#26685](https://github.com/nodejs/node/pull/26685)
++    * don't set the prototype of callbackified functions (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++    * rename callbackified function (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++    * increase function length when using `callbackify()` (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++    * prevent tampering with internals in `inspect()` (Ruben Bridgewater) [#26577](https://github.com/nodejs/node/pull/26577)
++    * fix proxy inspection (Ruben Bridgewater) [#26241](https://github.com/nodejs/node/pull/26241)
++    * prevent leaking internal properties (Ruben Bridgewater) [#24971](https://github.com/nodejs/node/pull/24971)
++    * protect against monkeypatched Object prototype for inspect() (Rich Trott) [#25953](https://github.com/nodejs/node/pull/25953)
++    * treat format arguments equally (Roman Reiss) [#23162](https://github.com/nodejs/node/pull/23162)
++* **win, fs**: detect if symlink target is a directory (Bartosz Sosnowski) [#23724](https://github.com/nodejs/node/pull/23724)
++* **zlib**:
++    * throw TypeError if callback is missing (Anna Henningsen) [#24929](https://github.com/nodejs/node/pull/24929)
++    * make “bare” constants un-enumerable (Anna Henningsen) [#24824](https://github.com/nodejs/node/pull/24824)
++
++### Semver-Major Commits
++
++* [[`afce912193`](https://github.com/nodejs/node/commit/afce912193)] - **(SEMVER-MAJOR)** **assert**: improve performance to instantiate errors (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`5a3623af74`](https://github.com/nodejs/node/commit/5a3623af74)] - **(SEMVER-MAJOR)** **assert**: validate required arguments (Ruben Bridgewater) [#26641](https://github.com/nodejs/node/pull/26641)
++* [[`7493db21b6`](https://github.com/nodejs/node/commit/7493db21b6)] - **(SEMVER-MAJOR)** **assert**: adjust loose assertions (Ruben Bridgewater) [#25008](https://github.com/nodejs/node/pull/25008)
++* [[`9d064439e5`](https://github.com/nodejs/node/commit/9d064439e5)] - **(SEMVER-MAJOR)** **async_hooks**: remove deprecated emitBefore and emitAfter (Matteo Collina) [#26530](https://github.com/nodejs/node/pull/26530)
++* [[`1a2cf6696f`](https://github.com/nodejs/node/commit/1a2cf6696f)] - **(SEMVER-MAJOR)** **async_hooks**: remove promise object from resource (Andreas Madsen) [#23443](https://github.com/nodejs/node/pull/23443)
++* [[`c992639fbd`](https://github.com/nodejs/node/commit/c992639fbd)] - **(SEMVER-MAJOR)** **bootstrap**: make Buffer and process non-enumerable (Ruben Bridgewater) [#24874](https://github.com/nodejs/node/pull/24874)
++* [[`6113ba96cb`](https://github.com/nodejs/node/commit/6113ba96cb)] - **(SEMVER-MAJOR)** **buffer**: harden SlowBuffer creation (ZYSzys) [#26272](https://github.com/nodejs/node/pull/26272)
++* [[`6fb7baf935`](https://github.com/nodejs/node/commit/6fb7baf935)] - **(SEMVER-MAJOR)** **buffer**: harden validation of buffer allocation size (ZYSzys) [#26162](https://github.com/nodejs/node/pull/26162)
++* [[`c6d29ccf5a`](https://github.com/nodejs/node/commit/c6d29ccf5a)] - **(SEMVER-MAJOR)** **buffer**: do proper error propagation in addon methods (Anna Henningsen) [#23939](https://github.com/nodejs/node/pull/23939)
++* [[`0aa4cfe3d6`](https://github.com/nodejs/node/commit/0aa4cfe3d6)] - **(SEMVER-MAJOR)** **build**: reset embedder string to "-node.0" (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`dfcc918e65`](https://github.com/nodejs/node/commit/dfcc918e65)] - **(SEMVER-MAJOR)** **build**: reset embedder string to "-node.0" (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`9334e45aa0`](https://github.com/nodejs/node/commit/9334e45aa0)] - **(SEMVER-MAJOR)** **build**: remove mips support (Ben Noordhuis) [#26192](https://github.com/nodejs/node/pull/26192)
++* [[`bb564a3688`](https://github.com/nodejs/node/commit/bb564a3688)] - **(SEMVER-MAJOR)** **build**: update prerequisites on progress towards Python 3 (cclauss) [#25766](https://github.com/nodejs/node/pull/25766)
++* [[`3c332abe28`](https://github.com/nodejs/node/commit/3c332abe28)] - **(SEMVER-MAJOR)** **build**: reset embedder string to "-node.0" (Michaël Zasso) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`765766be64`](https://github.com/nodejs/node/commit/765766be64)] - **(SEMVER-MAJOR)** **build**: add common `defines` (Refael Ackermann) [#23426](https://github.com/nodejs/node/pull/23426)
++* [[`896ae3ea22`](https://github.com/nodejs/node/commit/896ae3ea22)] - **(SEMVER-MAJOR)** **build,deps**: move gypfiles out 2/2 - moving (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`3531fe9320`](https://github.com/nodejs/node/commit/3531fe9320)] - **(SEMVER-MAJOR)** **build,deps**: add `NOMINMAX` to V8 Windows builds (Refael Ackermann) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`ff5d632a83`](https://github.com/nodejs/node/commit/ff5d632a83)] - **(SEMVER-MAJOR)** **build,deps**: fix V8 snapshot gyp dependencies (Refael Ackermann) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`ecf98b0839`](https://github.com/nodejs/node/commit/ecf98b0839)] - **(SEMVER-MAJOR)** **build,meta**: quiet/pretty make output by default (Refael Ackermann) [#26740](https://github.com/nodejs/node/pull/26740)
++* [[`2f477bd34d`](https://github.com/nodejs/node/commit/2f477bd34d)] - **(SEMVER-MAJOR)** **build,win**: mark x86 image as not SAFESEH (Refael Ackermann) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`99523758dc`](https://github.com/nodejs/node/commit/99523758dc)] - **(SEMVER-MAJOR)** **console**: don't use ANSI escape codes when TERM=dumb (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++* [[`2d1c033741`](https://github.com/nodejs/node/commit/2d1c033741)] - **(SEMVER-MAJOR)** **crypto**: decode missing passphrase errors (Tobias Nießen) [#25208](https://github.com/nodejs/node/pull/25208)
++* [[`b8018f407b`](https://github.com/nodejs/node/commit/b8018f407b)] - **(SEMVER-MAJOR)** **crypto**: move DEP0113 to End-of-Life (Tobias Nießen) [#26249](https://github.com/nodejs/node/pull/26249)
++* [[`bf3cb3f9b1`](https://github.com/nodejs/node/commit/bf3cb3f9b1)] - **(SEMVER-MAJOR)** **crypto**: remove deprecated crypto.\_toBuf (Tobias Nießen) [#25338](https://github.com/nodejs/node/pull/25338)
++* [[`0f63d84f80`](https://github.com/nodejs/node/commit/0f63d84f80)] - **(SEMVER-MAJOR)** **crypto**: set `DEFAULT\_ENCODING` property to non-enumerable (Antoine du Hamel) [#23222](https://github.com/nodejs/node/pull/23222)
++* [[`5801ee4ab0`](https://github.com/nodejs/node/commit/5801ee4ab0)] - **(SEMVER-MAJOR)** **deps**: silence irrelevant V8 warning (Michaël Zasso) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`152b6cd316`](https://github.com/nodejs/node/commit/152b6cd316)] - **(SEMVER-MAJOR)** **deps**: update postmortem metadata generation script (cjihrig) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`d182a67be9`](https://github.com/nodejs/node/commit/d182a67be9)] - **(SEMVER-MAJOR)** **deps**: V8: un-cherry-pick bd019bd (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`aac4b208ff`](https://github.com/nodejs/node/commit/aac4b208ff)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 6 commits (Michaël Zasso) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`683d961db8`](https://github.com/nodejs/node/commit/683d961db8)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick d82c9af (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`b501c16a5c`](https://github.com/nodejs/node/commit/b501c16a5c)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick e5f01ba (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`d99ae3becb`](https://github.com/nodejs/node/commit/d99ae3becb)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick d5f08e4 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`c4721cd1fa`](https://github.com/nodejs/node/commit/c4721cd1fa)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 6b09d21 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`20fcc1fa9b`](https://github.com/nodejs/node/commit/20fcc1fa9b)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick f0bb5d2 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`2f908a75cd`](https://github.com/nodejs/node/commit/2f908a75cd)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 5b0510d (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`315c581cd5`](https://github.com/nodejs/node/commit/315c581cd5)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 91f0cd0 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`715c5c2f02`](https://github.com/nodejs/node/commit/715c5c2f02)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 392316d (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`dfd68642a1`](https://github.com/nodejs/node/commit/dfd68642a1)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 2f79d68 (Anna Henningsen) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`d9a8418f46`](https://github.com/nodejs/node/commit/d9a8418f46)] - **(SEMVER-MAJOR)** **deps**: sync V8 gypfiles with 7.4 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`a8fe6b700f`](https://github.com/nodejs/node/commit/a8fe6b700f)] - **(SEMVER-MAJOR)** **deps**: update V8 to 7.4.288.13 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`e0b3de1e90`](https://github.com/nodejs/node/commit/e0b3de1e90)] - **(SEMVER-MAJOR)** **deps**: bump minimum icu version to 63 (Ujjwal Sharma) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`1c494b0a95`](https://github.com/nodejs/node/commit/1c494b0a95)] - **(SEMVER-MAJOR)** **deps**: silence irrelevant V8 warnings (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`cec35a5eb9`](https://github.com/nodejs/node/commit/cec35a5eb9)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 7803fa6 (Jon Kunkee) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`0d4d6b39a7`](https://github.com/nodejs/node/commit/0d4d6b39a7)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 58cefed (Jon Kunkee) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`bea1a386a3`](https://github.com/nodejs/node/commit/bea1a386a3)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick d3308d0 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`cf649c9b02`](https://github.com/nodejs/node/commit/cf649c9b02)] - **(SEMVER-MAJOR)** **deps**: V8: cherry-pick 74571c8 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`44d5401b8d`](https://github.com/nodejs/node/commit/44d5401b8d)] - **(SEMVER-MAJOR)** **deps**: cherry-pick fc0ddf5 from upstream V8 (Anna Henningsen) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`cefb8029cd`](https://github.com/nodejs/node/commit/cefb8029cd)] - **(SEMVER-MAJOR)** **deps**: sync V8 gypfiles with 7.3 (Ujjwal Sharma) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`d266e3e2cf`](https://github.com/nodejs/node/commit/d266e3e2cf)] - **(SEMVER-MAJOR)** **deps**: sync V8 gypfiles with 7.2 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`7b48713334`](https://github.com/nodejs/node/commit/7b48713334)] - **(SEMVER-MAJOR)** **deps**: update V8 to 7.3.492.25 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`6df7bd6c3b`](https://github.com/nodejs/node/commit/6df7bd6c3b)] - **(SEMVER-MAJOR)** **deps**: add s390 asm rules for OpenSSL-1.1.1 (Shigeki Ohtsu) [#19794](https://github.com/nodejs/node/pull/19794)
++* [[`5620727f30`](https://github.com/nodejs/node/commit/5620727f30)] - **(SEMVER-MAJOR)** **deps**: sync V8 gypfiles with 7.1 (Refael Ackermann) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`9b4bf7de6c`](https://github.com/nodejs/node/commit/9b4bf7de6c)] - **(SEMVER-MAJOR)** **deps**: update V8 to 7.1.302.28 (Michaël Zasso) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`89ca131994`](https://github.com/nodejs/node/commit/89ca131994)] - **(SEMVER-MAJOR)** **deps,build**: move gypfiles out 1/2 - required changes (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`4ed4fc1bcf`](https://github.com/nodejs/node/commit/4ed4fc1bcf)] - **(SEMVER-MAJOR)** **deps,build**: compute torque\_outputs in v8.gyp (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`50f15f4a29`](https://github.com/nodejs/node/commit/50f15f4a29)] - **(SEMVER-MAJOR)** **deps,build**: refactor v8 gypfiles (Refael Ackermann) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`309e7723ea`](https://github.com/nodejs/node/commit/309e7723ea)] - **(SEMVER-MAJOR)** **doc**: update behaviour of fs.writeFile (Sakthipriyan Vairamani (thefourtheye)) [#25080](https://github.com/nodejs/node/pull/25080)
++* [[`89740a4f0e`](https://github.com/nodejs/node/commit/89740a4f0e)] - **(SEMVER-MAJOR)** **doc**: add internal functionality details of util.inherits (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++* [[`1ed3c54ecb`](https://github.com/nodejs/node/commit/1ed3c54ecb)] - **(SEMVER-MAJOR)** **errors**: update error name (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`abafd38c8d`](https://github.com/nodejs/node/commit/abafd38c8d)] - **(SEMVER-MAJOR)** **fs**: use proper .destroy() implementation for SyncWriteStream (Matteo Collina) [#26690](https://github.com/nodejs/node/pull/26690)
++* [[`1cdeb9f956`](https://github.com/nodejs/node/commit/1cdeb9f956)] - **(SEMVER-MAJOR)** **fs**: improve mode validation (Ruben Bridgewater) [#26575](https://github.com/nodejs/node/pull/26575)
++* [[`70f4f08a9f`](https://github.com/nodejs/node/commit/70f4f08a9f)] - **(SEMVER-MAJOR)** **fs**: harden validation of start option in createWriteStream (ZYSzys) [#25579](https://github.com/nodejs/node/pull/25579)
++* [[`8f4b924f4a`](https://github.com/nodejs/node/commit/8f4b924f4a)] - **(SEMVER-MAJOR)** **fs**: make writeFile consistent with readFile wrt fd (Sakthipriyan Vairamani (thefourtheye)) [#23709](https://github.com/nodejs/node/pull/23709)
++* [[`907941d48e`](https://github.com/nodejs/node/commit/907941d48e)] - **(SEMVER-MAJOR)** **http**: validate timeout in ClientRequest() (cjihrig) [#26214](https://github.com/nodejs/node/pull/26214)
++* [[`bcf2886a84`](https://github.com/nodejs/node/commit/bcf2886a84)] - **(SEMVER-MAJOR)** **http**: return HTTP 431 on HPE\_HEADER\_OVERFLOW error (Albert Still) [#25605](https://github.com/nodejs/node/pull/25605)
++* [[`2cb8f24751`](https://github.com/nodejs/node/commit/2cb8f24751)] - **(SEMVER-MAJOR)** **http**: switch default parser to llhttp (Anna Henningsen) [#24870](https://github.com/nodejs/node/pull/24870)
++* [[`91748dd89c`](https://github.com/nodejs/node/commit/91748dd89c)] - **(SEMVER-MAJOR)** **http**: change DEP0066 to a runtime deprecation (Morgan Roderick) [#24167](https://github.com/nodejs/node/pull/24167)
++* [[`f3b49cfa7b`](https://github.com/nodejs/node/commit/f3b49cfa7b)] - **(SEMVER-MAJOR)** **http**: else case is not reachable (szabolcsit) [#24176](https://github.com/nodejs/node/pull/24176)
++* [[`3fe1e80896`](https://github.com/nodejs/node/commit/3fe1e80896)] - **(SEMVER-MAJOR)** **lib**: validate Error.captureStackTrace() calls (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`bfbce289c3`](https://github.com/nodejs/node/commit/bfbce289c3)] - **(SEMVER-MAJOR)** **lib**: refactor Error.captureStackTrace() usage (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`f9ddbb6b2f`](https://github.com/nodejs/node/commit/f9ddbb6b2f)] - **(SEMVER-MAJOR)** **lib**: move DTRACE\_\* probes out of global scope (James M Snell) [#26541](https://github.com/nodejs/node/pull/26541)
++* [[`c7e628f8b3`](https://github.com/nodejs/node/commit/c7e628f8b3)] - **(SEMVER-MAJOR)** **lib**: deprecate \_stream\_wrap (Sam Roberts) [#26245](https://github.com/nodejs/node/pull/26245)
++* [[`be78266fb3`](https://github.com/nodejs/node/commit/be78266fb3)] - **(SEMVER-MAJOR)** **lib**: don't use `util.inspect()` internals (Ruben Bridgewater) [#24971](https://github.com/nodejs/node/pull/24971)
++* [[`a02e3e2d5f`](https://github.com/nodejs/node/commit/a02e3e2d5f)] - **(SEMVER-MAJOR)** **lib**: improve error message for MODULE\_NOT\_FOUND (Ali Ijaz Sheikh) [#25690](https://github.com/nodejs/node/pull/25690)
++* [[`05cd1a0929`](https://github.com/nodejs/node/commit/05cd1a0929)] - **(SEMVER-MAJOR)** **lib**: requireStack property for MODULE\_NOT\_FOUND (Ali Ijaz Sheikh) [#25690](https://github.com/nodejs/node/pull/25690)
++* [[`29d3d1ea13`](https://github.com/nodejs/node/commit/29d3d1ea13)] - **(SEMVER-MAJOR)** **lib**: move DEP0029 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++* [[`a665d13ad9`](https://github.com/nodejs/node/commit/a665d13ad9)] - **(SEMVER-MAJOR)** **lib**: move DEP0028 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++* [[`10df21b071`](https://github.com/nodejs/node/commit/10df21b071)] - **(SEMVER-MAJOR)** **lib**: move DEP0027 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++* [[`2d578ad996`](https://github.com/nodejs/node/commit/2d578ad996)] - **(SEMVER-MAJOR)** **lib**: move DEP0026 to end of life (cjihrig) [#25377](https://github.com/nodejs/node/pull/25377)
++* [[`853bee0acf`](https://github.com/nodejs/node/commit/853bee0acf)] - **(SEMVER-MAJOR)** **lib**: move DEP0023 to end of life (cjihrig) [#25280](https://github.com/nodejs/node/pull/25280)
++* [[`d4934ae6f2`](https://github.com/nodejs/node/commit/d4934ae6f2)] - **(SEMVER-MAJOR)** **lib**: move DEP0006 to end of life (cjihrig) [#25279](https://github.com/nodejs/node/pull/25279)
++* [[`4100001624`](https://github.com/nodejs/node/commit/4100001624)] - **(SEMVER-MAJOR)** **lib**: remove unintended access to deps/ (Anna Henningsen) [#25138](https://github.com/nodejs/node/pull/25138)
++* [[`b416dafb87`](https://github.com/nodejs/node/commit/b416dafb87)] - **(SEMVER-MAJOR)** **lib**: move DEP0120 to end of life (cjihrig) [#24862](https://github.com/nodejs/node/pull/24862)
++* [[`59257543c3`](https://github.com/nodejs/node/commit/59257543c3)] - **(SEMVER-MAJOR)** **lib**: use ES6 class inheritance style (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++* [[`dcc82b37b6`](https://github.com/nodejs/node/commit/dcc82b37b6)] - **(SEMVER-MAJOR)** **lib**: remove `inherits()` usage (Ruben Bridgewater) [#24755](https://github.com/nodejs/node/pull/24755)
++* [[`60ce2fd827`](https://github.com/nodejs/node/commit/60ce2fd827)] - **(SEMVER-MAJOR)** **module**: don't search in require.resolve.paths (cjihrig) [#23683](https://github.com/nodejs/node/pull/23683)
++* [[`f0f26cedcc`](https://github.com/nodejs/node/commit/f0f26cedcc)] - **(SEMVER-MAJOR)** **n-api**: remove code from error name (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`96204c3c71`](https://github.com/nodejs/node/commit/96204c3c71)] - **(SEMVER-MAJOR)** **net**: do not manipulate potential user code (Ruben Bridgewater) [#26751](https://github.com/nodejs/node/pull/26751)
++* [[`9389b464ea`](https://github.com/nodejs/node/commit/9389b464ea)] - **(SEMVER-MAJOR)** **net**: emit "write after end" errors in the next tick (Ouyang Yadong) [#24457](https://github.com/nodejs/node/pull/24457)
++* [[`1523111250`](https://github.com/nodejs/node/commit/1523111250)] - **(SEMVER-MAJOR)** **net**: deprecate \_setSimultaneousAccepts() undocumented function (James M Snell) [#23760](https://github.com/nodejs/node/pull/23760)
++* [[`802ea05a37`](https://github.com/nodejs/node/commit/802ea05a37)] - **(SEMVER-MAJOR)** **net,http2**: merge setTimeout code (ZYSzys) [#25084](https://github.com/nodejs/node/pull/25084)
++* [[`16e4cd19f2`](https://github.com/nodejs/node/commit/16e4cd19f2)] - **(SEMVER-MAJOR)** **os**: implement os.type() using uv\_os\_uname() (cjihrig) [#25659](https://github.com/nodejs/node/pull/25659)
++* [[`53ebd3311d`](https://github.com/nodejs/node/commit/53ebd3311d)] - **(SEMVER-MAJOR)** **process**: global.process, global.Buffer getters (Guy Bedford) [#26882](https://github.com/nodejs/node/pull/26882)
++* [[`fa5e097530`](https://github.com/nodejs/node/commit/fa5e097530)] - **(SEMVER-MAJOR)** **process**: move DEP0062 (node --debug) to end-of-life (Joyee Cheung) [#25828](https://github.com/nodejs/node/pull/25828)
++* [[`154efc9bde`](https://github.com/nodejs/node/commit/154efc9bde)] - **(SEMVER-MAJOR)** **process**: exit on --debug and --debug-brk after option parsing (Joyee Cheung) [#25828](https://github.com/nodejs/node/pull/25828)
++* [[`3439c955ab`](https://github.com/nodejs/node/commit/3439c955ab)] - **(SEMVER-MAJOR)** **process**: improve `--redirect-warnings` handling (Ruben Bridgewater) [#24965](https://github.com/nodejs/node/pull/24965)
++* [[`d3a62fe7fc`](https://github.com/nodejs/node/commit/d3a62fe7fc)] - **(SEMVER-MAJOR)** **readline**: support TERM=dumb (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++* [[`97737fd5fb`](https://github.com/nodejs/node/commit/97737fd5fb)] - **(SEMVER-MAJOR)** **repl**: fix terminal default setting (Ruben Bridgewater) [#26518](https://github.com/nodejs/node/pull/26518)
++* [[`82b3ee776b`](https://github.com/nodejs/node/commit/82b3ee776b)] - **(SEMVER-MAJOR)** **repl**: check colors with .getColorDepth() (Vladislav Kaminsky) [#26261](https://github.com/nodejs/node/pull/26261)
++* [[`584305841d`](https://github.com/nodejs/node/commit/584305841d)] - **(SEMVER-MAJOR)** **repl**: deprecate REPLServer.rli (Ruben Bridgewater) [#26260](https://github.com/nodejs/node/pull/26260)
++* [[`0c0a394c9d`](https://github.com/nodejs/node/commit/0c0a394c9d)] - **(SEMVER-MAJOR)** **src**: update NODE\_MODULE\_VERSION to 72 (Ujjwal Sharma) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`96c3224de0`](https://github.com/nodejs/node/commit/96c3224de0)] - **(SEMVER-MAJOR)** **src**: remove `AddPromiseHook()` (Anna Henningsen) [#26574](https://github.com/nodejs/node/pull/26574)
++* [[`9577f7724d`](https://github.com/nodejs/node/commit/9577f7724d)] - **(SEMVER-MAJOR)** **src**: update NODE\_MODULE\_VERSION to 71 (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`6d9aa73b1f`](https://github.com/nodejs/node/commit/6d9aa73b1f)] - **(SEMVER-MAJOR)** **src**: clean up MultiIsolatePlatform interface (Anna Henningsen) [#26384](https://github.com/nodejs/node/pull/26384)
++* [[`1d996f58af`](https://github.com/nodejs/node/commit/1d996f58af)] - **(SEMVER-MAJOR)** **src**: properly configure default heap limits (Ali Ijaz Sheikh) [#25576](https://github.com/nodejs/node/pull/25576)
++* [[`9021b0d3fc`](https://github.com/nodejs/node/commit/9021b0d3fc)] - **(SEMVER-MAJOR)** **src**: remove icuDataDir from node config (GauthamBanasandra) [#24780](https://github.com/nodejs/node/pull/24780)
++* [[`a6f69ebc05`](https://github.com/nodejs/node/commit/a6f69ebc05)] - **(SEMVER-MAJOR)** **src**: explicitly allow JS in ReadHostObject (Yang Guo) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`3d25544148`](https://github.com/nodejs/node/commit/3d25544148)] - **(SEMVER-MAJOR)** **src**: update postmortem constant (cjihrig) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`23603447ad`](https://github.com/nodejs/node/commit/23603447ad)] - **(SEMVER-MAJOR)** **src**: update NODE\_MODULE\_VERSION to 68 (Michaël Zasso) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`4e1e7c37d1`](https://github.com/nodejs/node/commit/4e1e7c37d1)] - **(SEMVER-MAJOR)** **test**: update postmortem metadata test for V8 7.4 (cjihrig) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`e96e3f9eb0`](https://github.com/nodejs/node/commit/e96e3f9eb0)] - **(SEMVER-MAJOR)** **test**: remove redundant common.mustCall (Ruben Bridgewater) [#26738](https://github.com/nodejs/node/pull/26738)
++* [[`01b112a031`](https://github.com/nodejs/node/commit/01b112a031)] - **(SEMVER-MAJOR)** **test**: update postmortem metadata test for V8 7.3 (cjihrig) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`38ad285a2e`](https://github.com/nodejs/node/commit/38ad285a2e)] - **(SEMVER-MAJOR)** **test**: fix tests after V8 update (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`260d5f8c3b`](https://github.com/nodejs/node/commit/260d5f8c3b)] - **(SEMVER-MAJOR)** **test**: update test-v8-stats (Michaël Zasso) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`78c8491a7e`](https://github.com/nodejs/node/commit/78c8491a7e)] - **(SEMVER-MAJOR)** **test**: remove apply calls over 65534 arg limit (Peter Marshall) [#25852](https://github.com/nodejs/node/pull/25852)
++* [[`22a9fe3552`](https://github.com/nodejs/node/commit/22a9fe3552)] - **(SEMVER-MAJOR)** **test**: add test for net-socket-setTimeout callback (ZYSzys) [#25084](https://github.com/nodejs/node/pull/25084)
++* [[`379bf1aa8e`](https://github.com/nodejs/node/commit/379bf1aa8e)] - **(SEMVER-MAJOR)** **test**: update postmortem metadata test for V8 7.1 (cjihrig) [#23423](https://github.com/nodejs/node/pull/23423)
++* [[`624a242b05`](https://github.com/nodejs/node/commit/624a242b05)] - **(SEMVER-MAJOR)** **test**: simplify regression test for SEGV (Sam Roberts) [#24241](https://github.com/nodejs/node/pull/24241)
++* [[`42dbaed460`](https://github.com/nodejs/node/commit/42dbaed460)] - **(SEMVER-MAJOR)** **tls**: support TLSv1.3 (Sam Roberts) [#26209](https://github.com/nodejs/node/pull/26209)
++* [[`0f745bf9bd`](https://github.com/nodejs/node/commit/0f745bf9bd)] - **(SEMVER-MAJOR)** **tls**: return correct version from getCipher() (Sam Roberts) [#26625](https://github.com/nodejs/node/pull/26625)
++* [[`6b7c402518`](https://github.com/nodejs/node/commit/6b7c402518)] - **(SEMVER-MAJOR)** **tls**: check arg types of renegotiate() (Sam Roberts) [#25876](https://github.com/nodejs/node/pull/25876)
++* [[`b05b330025`](https://github.com/nodejs/node/commit/b05b330025)] - **(SEMVER-MAJOR)** **tls**: add code for ERR\_TLS\_INVALID\_PROTOCOL\_METHOD (Sam Roberts) [#24729](https://github.com/nodejs/node/pull/24729)
++* [[`9b2ffff62c`](https://github.com/nodejs/node/commit/9b2ffff62c)] - **(SEMVER-MAJOR)** **tls**: emit a warning when servername is an IP address (Rodger Combs) [#23329](https://github.com/nodejs/node/pull/23329)
++* [[`60eca6a5d4`](https://github.com/nodejs/node/commit/60eca6a5d4)] - **(SEMVER-MAJOR)** **tls**: disable TLS v1.0 and v1.1 by default (Ben Noordhuis) [#23814](https://github.com/nodejs/node/pull/23814)
++* [[`3b4159c8ed`](https://github.com/nodejs/node/commit/3b4159c8ed)] - **(SEMVER-MAJOR)** **tls**: remove unused arg to createSecureContext() (Sam Roberts) [#24241](https://github.com/nodejs/node/pull/24241)
++* [[`246a6fc107`](https://github.com/nodejs/node/commit/246a6fc107)] - **(SEMVER-MAJOR)** **tls**: deprecate Server.prototype.setOptions() (cjihrig) [#23820](https://github.com/nodejs/node/pull/23820)
++* [[`87719d792b`](https://github.com/nodejs/node/commit/87719d792b)] - **(SEMVER-MAJOR)** **tls**: load NODE\_EXTRA\_CA\_CERTS at startup (Ouyang Yadong) [#23354](https://github.com/nodejs/node/pull/23354)
++* [[`80b8988ad0`](https://github.com/nodejs/node/commit/80b8988ad0)] - **(SEMVER-MAJOR)** **util**: only the first line of the error message (Simon Zünd) [#26685](https://github.com/nodejs/node/pull/26685)
++* [[`7a1f3447cc`](https://github.com/nodejs/node/commit/7a1f3447cc)] - **(SEMVER-MAJOR)** **util**: don't set the prototype of callbackified functions (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++* [[`c5602d764c`](https://github.com/nodejs/node/commit/c5602d764c)] - **(SEMVER-MAJOR)** **util**: rename callbackified function (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++* [[`0eb50ba072`](https://github.com/nodejs/node/commit/0eb50ba072)] - **(SEMVER-MAJOR)** **util**: increase function length when using `callbackify()` (Ruben Bridgewater) [#26893](https://github.com/nodejs/node/pull/26893)
++* [[`5672ab7668`](https://github.com/nodejs/node/commit/5672ab7668)] - **(SEMVER-MAJOR)** **util**: prevent tampering with internals in `inspect()` (Ruben Bridgewater) [#26577](https://github.com/nodejs/node/pull/26577)
++* [[`a32cbe1597`](https://github.com/nodejs/node/commit/a32cbe1597)] - **(SEMVER-MAJOR)** **util**: fix proxy inspection (Ruben Bridgewater) [#26241](https://github.com/nodejs/node/pull/26241)
++* [[`7b674697d8`](https://github.com/nodejs/node/commit/7b674697d8)] - **(SEMVER-MAJOR)** **util**: prevent leaking internal properties (Ruben Bridgewater) [#24971](https://github.com/nodejs/node/pull/24971)
++* [[`1847696f4b`](https://github.com/nodejs/node/commit/1847696f4b)] - **(SEMVER-MAJOR)** **util**: protect against monkeypatched Object prototype for inspect() (Rich Trott) [#25953](https://github.com/nodejs/node/pull/25953)
++* [[`c1b9be53c8`](https://github.com/nodejs/node/commit/c1b9be53c8)] - **(SEMVER-MAJOR)** **util**: treat format arguments equally (Roman Reiss) [#23162](https://github.com/nodejs/node/pull/23162)
++* [[`cda6b20816`](https://github.com/nodejs/node/commit/cda6b20816)] - **(SEMVER-MAJOR)** **win, fs**: detect if symlink target is a directory (Bartosz Sosnowski) [#23724](https://github.com/nodejs/node/pull/23724)
++* [[`9a2654601e`](https://github.com/nodejs/node/commit/9a2654601e)] - **(SEMVER-MAJOR)** **zlib**: throw TypeError if callback is missing (Anna Henningsen) [#24929](https://github.com/nodejs/node/pull/24929)
++* [[`4eee55d354`](https://github.com/nodejs/node/commit/4eee55d354)] - **(SEMVER-MAJOR)** **zlib**: make “bare” constants un-enumerable (Anna Henningsen) [#24824](https://github.com/nodejs/node/pull/24824)
++
++### Semver-Minor Commits
++
++TBD
++
++### Semver-Patch Commits
++
++TBD
+\ No newline at end of file
+diff --git a/doc/changelogs/CHANGELOG_V4.md b/doc/changelogs/CHANGELOG_V4.md
+index 4a7077abfc4351d38ffa3135fe90b6f3382ad962..a28e0451ad5d3a45c6f9032d795410fdb0f0248a 100644
+--- a/doc/changelogs/CHANGELOG_V4.md
++++ b/doc/changelogs/CHANGELOG_V4.md
+@@ -57,6 +57,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V5.md b/doc/changelogs/CHANGELOG_V5.md
+index a78397afe7bdee1d128b5de4c252d5f27b64ddab..855e1ae8ee4b67276efc0168d849a6c554497160 100644
+--- a/doc/changelogs/CHANGELOG_V5.md
++++ b/doc/changelogs/CHANGELOG_V5.md
+@@ -33,6 +33,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V6.md b/doc/changelogs/CHANGELOG_V6.md
+index b65fe43eff807715f91db84f5570ccaeeff561fd..78555026be764bafeea90d1c2b43728d2774ebaf 100644
+--- a/doc/changelogs/CHANGELOG_V6.md
++++ b/doc/changelogs/CHANGELOG_V6.md
+@@ -61,6 +61,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V7.md b/doc/changelogs/CHANGELOG_V7.md
+index 4dcd58a6fddabf52fa930702052ccd057123c940..f4128693ba0e891439e7e24c27fcde22dfb9a325 100644
+--- a/doc/changelogs/CHANGELOG_V7.md
++++ b/doc/changelogs/CHANGELOG_V7.md
+@@ -31,6 +31,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V8.md b/doc/changelogs/CHANGELOG_V8.md
+index b6228ce86209f60bfd1dc31ca99f3ea937a28b55..76d5cbee578023ee7f37dd53b949a6618414e621 100644
+--- a/doc/changelogs/CHANGELOG_V8.md
++++ b/doc/changelogs/CHANGELOG_V8.md
+@@ -50,6 +50,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [9.x](CHANGELOG_V9.md)
+diff --git a/doc/changelogs/CHANGELOG_V9.md b/doc/changelogs/CHANGELOG_V9.md
+index 646327d153776d61cbc4a8fa1c31eebc07710672..b7a50bf43e07b6f6545066cf73acd3998820e4c2 100644
+--- a/doc/changelogs/CHANGELOG_V9.md
++++ b/doc/changelogs/CHANGELOG_V9.md
+@@ -32,6 +32,7 @@
+ </table>
+ 
+ * Other Versions
++  * [12.x](CHANGELOG_V12.md)
+   * [11.x](CHANGELOG_V11.md)
+   * [10.x](CHANGELOG_V10.md)
+   * [8.x](CHANGELOG_V8.md)
+diff --git a/src/node_version.h b/src/node_version.h
+index 349d73d18de93b4a5cedaa953887264ee1d5a2d9..ac2a13fe2db8d9ee03f620fbbd0afb68c33784f2 100644
+--- a/src/node_version.h
++++ b/src/node_version.h
+@@ -29,7 +29,7 @@
+ #define NODE_VERSION_IS_LTS 0
+ #define NODE_VERSION_LTS_CODENAME ""
+ 
+-#define NODE_VERSION_IS_RELEASE 0
++#define NODE_VERSION_IS_RELEASE 1
+ 
+ #ifndef NODE_STRINGIFY
+ #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)

+ 48 - 0
patches/common/node/allow_embedder_to_reuse_the_per_process_nativemoduleloader.patch

@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Tue, 26 Feb 2019 17:04:14 -0800
+Subject: Allow embedder to reuse the per process NativeModuleLoader
+
+
+diff --git a/src/node_native_module.cc b/src/node_native_module.cc
+index 41f1588c4da7929989625c5706b009991722178d..47d3d94f1277904e3128dc03aee0f41c26ab91b0 100644
+--- a/src/node_native_module.cc
++++ b/src/node_native_module.cc
+@@ -115,6 +115,7 @@ Local<String> NativeModuleLoader::GetConfigString(Isolate* isolate) const {
+ 
+ NativeModuleLoader::NativeModuleLoader() : config_(GetConfig()) {
+   LoadJavaScriptSource();
++  LoadEmbedderJavaScriptSource();
+   LoadCodeCache();
+ }
+ 
+diff --git a/src/node_native_module.h b/src/node_native_module.h
+index be1fc92a7672f38dff6213df081800e4e6b99ad1..cbf625fc4df290cf774ce394f525019e331cd79c 100644
+--- a/src/node_native_module.h
++++ b/src/node_native_module.h
+@@ -26,7 +26,7 @@ using NativeModuleCacheMap =
+ // This class should not depend on a particular isolate, context, or
+ // environment. Rather it should take them as arguments when necessary.
+ // The instances of this class are per-process.
+-class NativeModuleLoader {
++class NODE_EXTERN NativeModuleLoader {
+  public:
+   NativeModuleLoader();
+   // TODO(joyeecheung): maybe we should make this a singleton, instead of
+@@ -72,6 +72,7 @@ class NativeModuleLoader {
+ 
+   // Generated by tools/js2c.py as node_javascript.cc
+   void LoadJavaScriptSource();  // Loads data into source_
++  void LoadEmbedderJavaScriptSource();  // Loads embedder data into source_
+   UnionBytes GetConfig();       // Return data for config.gypi
+ 
+   // Generated by tools/generate_code_cache.js as node_code_cache.cc when
+@@ -95,7 +96,7 @@ class NativeModuleLoader {
+ }  // namespace native_module
+ 
+ namespace per_process {
+-extern native_module::NativeModuleLoader native_module_loader;
++NODE_EXTERN extern native_module::NativeModuleLoader native_module_loader;
+ }  // namespace per_process
+ 
+ }  // namespace node

+ 1655 - 0
patches/common/node/build_add_gn_build_files.patch

@@ -0,0 +1,1655 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Apthorp <[email protected]>
+Date: Tue, 26 Feb 2019 17:07:45 -0800
+Subject: build: add GN build files
+
+
+diff --git a/BUILD.gn b/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..028b0ae16ffac1fc89128f2f994680923a500a36
+--- /dev/null
++++ b/BUILD.gn
+@@ -0,0 +1,351 @@
++import("//electron/build/asar.gni")
++import("//v8/gni/v8.gni")
++
++declare_args() {
++  # Enable the V8 inspector protocol for use with node.
++  node_enable_inspector = true
++
++  # Build node with SSL support.
++  # The variable is called "openssl" for parity with node's GYP build.
++  node_use_openssl = true
++
++  # Use the specified path to system CA (PEM format) in addition to
++  # the BoringSSL supplied CA store or compiled-in Mozilla CA copy.
++  node_openssl_system_ca_path = ""
++
++  # Initialize v8 platform during node.js startup.
++  # NB. this must be turned off in Electron, because Electron initializes the
++  # v8 platform itself.
++  node_use_v8_platform = false
++
++  # Build with DTrace support.
++  node_use_dtrace = false
++
++  # Build with ETW support.
++  node_use_etw = false
++
++  # Build JavaScript in lib/ with DCHECK macros.
++  node_debug_lib = false
++
++  # Custom build tag.
++  node_tag = ""
++
++  # V8 options to pass, see `node --v8-options` for examples
++  node_v8_options = ""
++
++  # Provide a custom URL prefix for the `process.release` properties
++  # `sourceUrl` and `headersUrl`. When compiling a release build, this will
++  # default to https://nodejs.org/download/release/')
++  node_release_urlbase = ""
++}
++
++assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
++assert(!node_use_etw, "node_use_etw not supported in GN")
++
++assert(!node_enable_inspector || node_use_openssl,
++       "node_enable_inspector requires node_use_openssl")
++
++config("node_internals") {
++  defines = [ "NODE_WANT_INTERNALS=1" ]
++}
++
++node_files = read_file("filenames.json", "json")
++library_files = node_files.library_files
++
++copy("node_js2c_inputs") {
++  sources = library_files
++  outputs = [
++    "$target_gen_dir/js2c_inputs/{{source_target_relative}}",
++  ]
++}
++
++action("generate_config_gypi") {
++  outputs = [
++    "$target_gen_dir/config.gypi",
++  ]
++  script = "tools/generate_config_gypi.py"
++  args = rebase_path(outputs, root_build_dir)
++}
++
++chdir_action("node_js2c") {
++  deps = [
++    ":generate_config_gypi",
++    ":node_js2c_inputs",
++  ]
++
++  macro_inputs = []
++  if (!node_use_dtrace && !node_use_etw) {
++    macro_inputs += [ "src/notrace_macros.py" ]
++  }
++  if (node_debug_lib) {
++    macro_inputs += [ "tools/nodcheck_macros.py" ]
++  } else {
++    macro_inputs += [ "tools/dcheck_macros.py" ]
++  }
++  macro_inputs += [ "tools/check_macros.py" ]
++
++  config_gypi = [ "$target_gen_dir/config.gypi" ]
++
++  inputs = library_files + macro_inputs + config_gypi
++  outputs = [
++    "$target_gen_dir/node_javascript.cc",
++  ]
++
++  cwd = "$target_gen_dir/js2c_inputs"
++  script = "tools/js2c.py"
++  args = rebase_path(outputs)
++  args += library_files
++  args += rebase_path(macro_inputs + config_gypi)
++}
++
++config("node_features") {
++  defines = []
++  if (node_enable_inspector) {
++    defines += [ "HAVE_INSPECTOR=1" ]
++  } else {
++    defines += [ "HAVE_INSPECTOR=0" ]
++  }
++  if (node_use_openssl) {
++    defines += [ "HAVE_OPENSSL=1" ]
++  } else {
++    defines += [ "HAVE_OPENSSL=0" ]
++  }
++  if (v8_enable_i18n_support) {
++    defines += [ "NODE_HAVE_I18N_SUPPORT=1" ]
++  } else {
++    defines += [ "NODE_HAVE_I18N_SUPPORT=0" ]
++  }
++  if (node_use_v8_platform) {
++    defines += [ "NODE_USE_V8_PLATFORM=1" ]
++  } else {
++    defines += [ "NODE_USE_V8_PLATFORM=0" ]
++  }
++}
++
++config("node_lib_config") {
++  include_dirs = [ "src" ]
++
++  # FIXME(deepak1556): include paths should be corrected,
++  # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
++  cflags = [ "-Wno-microsoft-include" ]
++
++  configs = [ ":node_features" ]
++
++  if (is_debug) {
++    defines = [ "DEBUG" ]
++  }
++}
++
++config("node_internal_config") {
++  visibility = [
++    ":*",
++    "src/inspector:*",
++  ]
++  defines = [
++    "NODE_WANT_INTERNALS=1",
++    "NODE_IMPLEMENTATION",
++  ]
++  if (is_component_build) {
++    defines += [
++      "BUILDING_V8_SHARED",
++      "BUILDING_V8_PLATFORM_SHARED",
++      "BUILDING_V8_BASE_SHARED",
++      "NODE_SHARED_MODE",
++    ]
++  }
++
++  if (target_cpu == "x86") {
++    node_arch = "ia32"
++  } else {
++    node_arch = target_cpu
++  }
++  defines += [ "NODE_ARCH=\"$node_arch\"" ]
++
++  if (target_os == "win") {
++    node_platform = "win32"
++  } else if (target_os == "mac") {
++    node_platform = "darwin"
++  } else {
++    node_platform = target_os
++  }
++  defines += [ "NODE_PLATFORM=\"$node_platform\"" ]
++
++  if (is_win) {
++    defines += [
++      "NOMINMAX",
++      "_UNICODE=1",
++    ]
++  } else {
++    defines += [ "__POSIX__" ]
++  }
++
++  if (node_tag != "") {
++    defines += [ "NODE_TAG=\"$node_tag\"" ]
++  }
++  if (node_v8_options != "") {
++    defines += [ "NODE_V8_OPTIONS=\"$node_v8_options\"" ]
++  }
++  if (node_release_urlbase != "") {
++    defines += [ "NODE_RELEASE_URLBASE=\"$node_release_urlbase\"" ]
++  }
++
++  if (node_use_openssl) {
++    defines += [
++      "NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"",
++      "EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG",
++    ]
++  }
++}
++
++component("node_lib") {
++  deps = [
++    ":node_js2c",
++    "//third_party/brotli:enc",
++    "//third_party/brotli:dec",
++    "deps/cares",
++    "deps/histogram",
++    "deps/http_parser",
++    "deps/llhttp",
++    "deps/nghttp2",
++    "deps/zlib",
++    "//v8:v8_libplatform",
++  ]
++  public_deps = [
++    "deps/uv",
++    "//electron:atom_js2c",
++    "//v8",
++  ]
++  configs += [ ":node_internal_config" ]
++  public_configs = [ ":node_lib_config" ]
++  include_dirs = [ "src" ]
++  libs = []
++  cflags_cc = [
++    "-Wno-deprecated-declarations",
++    "-Wno-implicit-fallthrough",
++    "-Wno-return-type",
++    "-Wno-sometimes-uninitialized",
++    "-Wno-string-plus-int",
++    "-Wno-unused-function",
++    "-Wno-unused-label",
++    "-Wno-unused-private-field",
++    "-Wno-unused-variable",
++  ]
++
++  if (v8_enable_i18n_support) {
++    deps += [ "//third_party/icu" ]
++  }
++
++  sources = node_files.node_sources
++  sources += [
++    "$root_gen_dir/atom_natives.cc",
++    "$target_gen_dir/node_javascript.cc",
++    "src/node_code_cache_stub.cc",
++  ]
++
++  if (is_win) {
++    libs += [ "psapi.lib" ]
++  }
++  if (is_mac) {
++    libs += [ "CoreFoundation.framework" ]
++  }
++
++  if (node_enable_inspector) {
++    sources += [
++      "src/inspector_agent.cc",
++      "src/inspector_agent.h",
++      "src/inspector_io.cc",
++      "src/inspector_io.h",
++      "src/inspector_profiler.cc",
++      "src/inspector_js_api.cc",
++      "src/inspector_socket.cc",
++      "src/inspector_socket.h",
++      "src/inspector_socket_server.cc",
++      "src/inspector_socket_server.h",
++    ]
++    deps += [ "src/inspector" ]
++  }
++
++  if (node_use_openssl) {
++    deps += [ "//third_party/boringssl" ]
++    sources += [
++      "src/node_crypto.cc",
++      "src/node_crypto.h",
++      "src/node_crypto_bio.cc",
++      "src/node_crypto_bio.h",
++      "src/node_crypto_clienthello-inl.h",
++      "src/node_crypto_clienthello.cc",
++      "src/node_crypto_clienthello.h",
++      "src/node_crypto_groups.h",
++      "src/tls_wrap.cc",
++      "src/tls_wrap.h",
++    ]
++    cflags_cc += [ "-Wno-sign-compare" ]
++  }
++}
++
++##### node_headers
++
++node_headers_dir = "$root_gen_dir/node_headers"
++
++header_group_index = 0
++header_groups = []
++foreach(header_group, node_files.headers) {
++  copy("node_headers_${header_group_index}") {
++    sources = header_group.files
++    outputs = [
++      "$node_headers_dir/${header_group.dest_dir}/{{source_file_part}}",
++    ]
++  }
++  header_groups += [ ":node_headers_${header_group_index}" ]
++  header_group_index += 1
++}
++
++copy("zlib_headers") {
++  sources = [
++    "deps/zlib/zconf.h",
++    "deps/zlib/zlib.h",
++  ]
++  outputs = [
++    "$node_headers_dir/include/node/{{source_file_part}}",
++  ]
++}
++
++copy("node_gypi_headers") {
++  deps = [
++    ":generate_config_gypi",
++  ]
++  sources = [
++    "$target_gen_dir/config.gypi",
++    "common.gypi",
++  ]
++  outputs = [
++    "$node_headers_dir/include/node/{{source_file_part}}",
++  ]
++}
++
++action("tar_headers") {
++  deps = [
++    ":copy_headers",
++  ]
++  outputs = [
++    "$root_gen_dir/node_headers.tar.gz",
++  ]
++  script = "tools/tar.py"
++  args = [
++    rebase_path("$root_gen_dir/node_headers"),
++    rebase_path(outputs[0]),
++  ]
++}
++
++group("copy_headers") {
++  public_deps = header_groups + [
++                  ":zlib_headers",
++                  ":node_gypi_headers",
++                ]
++}
++
++group("headers") {
++  public_deps = [
++    ":tar_headers",
++  ]
++}
+diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..0b7737ca061ae6a12647f5d7bf0c2d1bc7d5bdd9
+--- /dev/null
++++ b/deps/cares/BUILD.gn
+@@ -0,0 +1,126 @@
++config("cares_config") {
++  include_dirs = [ "include" ]
++}
++static_library("cares") {
++  defines = [ "CARES_STATICLIB" ]
++  include_dirs = [
++    "include",
++    "src",
++  ]
++  public_configs = [ ":cares_config" ]
++
++  libs = []
++  cflags_c = [
++    "-Wno-logical-not-parentheses",
++    "-Wno-sign-compare",
++  ]
++
++  sources = [
++    "include/ares.h",
++    "include/ares_rules.h",
++    "include/ares_version.h",
++    "include/nameser.h",
++    "src/ares__close_sockets.c",
++    "src/ares__get_hostent.c",
++    "src/ares__read_line.c",
++    "src/ares__timeval.c",
++    "src/ares_android.c",
++    "src/ares_cancel.c",
++    "src/ares_create_query.c",
++    "src/ares_data.c",
++    "src/ares_data.h",
++    "src/ares_destroy.c",
++    "src/ares_dns.h",
++    "src/ares_expand_name.c",
++    "src/ares_expand_string.c",
++    "src/ares_fds.c",
++    "src/ares_free_hostent.c",
++    "src/ares_free_string.c",
++    "src/ares_getenv.h",
++    "src/ares_gethostbyaddr.c",
++    "src/ares_gethostbyname.c",
++    "src/ares_getnameinfo.c",
++    "src/ares_getopt.c",
++    "src/ares_getopt.h",
++    "src/ares_getsock.c",
++    "src/ares_inet_net_pton.h",
++    "src/ares_init.c",
++    "src/ares_ipv6.h",
++    "src/ares_library_init.c",
++    "src/ares_library_init.h",
++    "src/ares_llist.c",
++    "src/ares_llist.h",
++    "src/ares_mkquery.c",
++    "src/ares_nowarn.c",
++    "src/ares_nowarn.h",
++    "src/ares_options.c",
++    "src/ares_parse_a_reply.c",
++    "src/ares_parse_aaaa_reply.c",
++    "src/ares_parse_mx_reply.c",
++    "src/ares_parse_naptr_reply.c",
++    "src/ares_parse_ns_reply.c",
++    "src/ares_parse_ptr_reply.c",
++    "src/ares_parse_soa_reply.c",
++    "src/ares_parse_srv_reply.c",
++    "src/ares_parse_txt_reply.c",
++    "src/ares_platform.h",
++    "src/ares_private.h",
++    "src/ares_process.c",
++    "src/ares_query.c",
++    "src/ares_search.c",
++    "src/ares_send.c",
++    "src/ares_setup.h",
++    "src/ares_strcasecmp.c",
++    "src/ares_strcasecmp.h",
++    "src/ares_strdup.c",
++    "src/ares_strdup.h",
++    "src/ares_strerror.c",
++    "src/ares_strsplit.c",
++    "src/ares_timeout.c",
++    "src/ares_version.c",
++    "src/ares_writev.c",
++    "src/ares_writev.h",
++    "src/bitncmp.c",
++    "src/bitncmp.h",
++    "src/inet_net_pton.c",
++    "src/inet_ntop.c",
++    "src/setup_once.h",
++  ]
++
++  if (!is_win) {
++    defines += [
++      "_DARWIN_USE_64_BIT_INODE=1",
++      "_LARGEFILE_SOURCE",
++      "_FILE_OFFSET_BITS=64",
++      "_GNU_SOURCE",
++    ]
++  }
++
++  if (is_win) {
++    defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
++    include_dirs += [ "config/win32" ]
++    sources += [
++      "src/ares_getenv.c",
++      "src/ares_iphlpapi.h",
++      "src/ares_platform.c",
++      "src/config-win32.h",
++      "src/windows_port.c",
++    ]
++    libs += [
++      "ws2_32.lib",
++      "iphlpapi.lib",
++    ]
++  } else {
++    defines += [ "HAVE_CONFIG_H" ]
++  }
++
++  if (is_linux) {
++    include_dirs += [ "config/linux" ]
++    sources += [ "config/linux/ares_config.h" ]
++  }
++
++  if (is_mac) {
++    include_dirs += [ "config/darwin" ]
++    sources += [ "config/darwin/ares_config.h" ]
++  }
++}
+diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..e741a2a9c238a782a674ddcb9a1f98de5b36db79
+--- /dev/null
++++ b/deps/histogram/BUILD.gn
+@@ -0,0 +1,17 @@
++config("histogram_config") {
++  include_dirs = [ "src" ]
++
++  cflags = [
++    "-Wno-implicit-function-declaration",
++    "-Wno-incompatible-pointer-types",
++  ]
++}
++
++static_library("histogram") {
++  public_configs = [ ":histogram_config" ]
++
++  sources = [
++    "src/hdr_histogram.c",
++    "src/hdr_histogram.h",
++  ]
++}
+diff --git a/deps/http_parser/BUILD.gn b/deps/http_parser/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..da9e2b42dccacc1ed9b00202c1ff73ebc60d0e8a
+--- /dev/null
++++ b/deps/http_parser/BUILD.gn
+@@ -0,0 +1,13 @@
++config("http_parser_config") {
++  defines = [ "HTTP_PARSER_STRICT=0" ]
++  include_dirs = [ "." ]
++}
++
++static_library("http_parser") {
++  include_dirs = [ "." ]
++  public_configs = [ ":http_parser_config" ]
++  cflags_c = [ "-Wno-string-conversion" ]
++  sources = [
++    "http_parser.c",
++  ]
++}
+diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..e34e241e6733b19bf1b5762ad1307af0eba383f6
+--- /dev/null
++++ b/deps/llhttp/BUILD.gn
+@@ -0,0 +1,13 @@
++config("llhttp_config") {
++  include_dirs = [ "include" ]
++}
++
++static_library("llhttp") {
++  include_dirs = [ "include" ]
++  public_configs = [ ":llhttp_config" ]
++  sources = [
++    "src/api.c",
++    "src/http.c",
++    "src/llhttp.c",
++  ]
++}
+diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..66af819990b338caa49ca59d1fe6c5ad61816d05
+--- /dev/null
++++ b/deps/nghttp2/BUILD.gn
+@@ -0,0 +1,46 @@
++config("nghttp2_config") {
++  defines = [ "NGHTTP2_STATICLIB" ]
++  include_dirs = [ "lib/includes" ]
++}
++static_library("nghttp2") {
++  public_configs = [ ":nghttp2_config" ]
++  defines = [
++    "_U_",
++    "BUILDING_NGHTTP2",
++    "NGHTTP2_STATICLIB",
++  ]
++  include_dirs = [ "lib/includes" ]
++  if (is_win) {
++    defines += [ "HAVE_CONFIG_H" ]
++  }
++
++  cflags_c = [
++    "-Wno-implicit-function-declaration",
++    "-Wno-string-plus-int",
++  ]
++
++  sources = [
++    "lib/nghttp2_buf.c",
++    "lib/nghttp2_callbacks.c",
++    "lib/nghttp2_debug.c",
++    "lib/nghttp2_frame.c",
++    "lib/nghttp2_hd.c",
++    "lib/nghttp2_hd_huffman.c",
++    "lib/nghttp2_hd_huffman_data.c",
++    "lib/nghttp2_helper.c",
++    "lib/nghttp2_http.c",
++    "lib/nghttp2_map.c",
++    "lib/nghttp2_mem.c",
++    "lib/nghttp2_npn.c",
++    "lib/nghttp2_option.c",
++    "lib/nghttp2_outbound_item.c",
++    "lib/nghttp2_pq.c",
++    "lib/nghttp2_priority_spec.c",
++    "lib/nghttp2_queue.c",
++    "lib/nghttp2_rcbuf.c",
++    "lib/nghttp2_session.c",
++    "lib/nghttp2_stream.c",
++    "lib/nghttp2_submit.c",
++    "lib/nghttp2_version.c",
++  ]
++}
+diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..b62fac6738ae74788faa6e5dcc705b81d8325ece
+--- /dev/null
++++ b/deps/uv/BUILD.gn
+@@ -0,0 +1,188 @@
++config("libuv_config") {
++  include_dirs = [ "include" ]
++
++  defines = []
++
++  if (is_linux) {
++    defines += [ "_POSIX_C_SOURCE=200112" ]
++  }
++  if (!is_win) {
++    defines += [
++      "_LARGEFILE_SOURCE",
++      "_FILE_OFFSET_BITS=64",
++    ]
++  }
++  if (is_mac) {
++    defines += [ "_DARWIN_USE_64_BIT_INODE=1" ]
++  }
++}
++
++static_library("uv") {
++  include_dirs = [
++    "include",
++    "src",
++  ]
++
++  public_configs = [ ":libuv_config" ]
++
++  ldflags = []
++
++  defines = []
++
++  cflags_c = [
++    "-Wno-bitwise-op-parentheses",
++    "-Wno-implicit-function-declaration",
++    "-Wno-missing-braces",
++    "-Wno-sign-compare",
++    "-Wno-sometimes-uninitialized",
++    "-Wno-string-conversion",
++    "-Wno-switch",
++    "-Wno-unused-function",
++    "-Wno-unused-variable",
++  ]
++
++  libs = []
++
++  sources = [
++    "include/uv.h",
++    "include/uv/errno.h",
++    "include/uv/threadpool.h",
++    "include/uv/tree.h",
++    "include/uv/version.h",
++    "src/fs-poll.c",
++    "src/heap-inl.h",
++    "src/idna.c",
++    "src/idna.h",
++    "src/inet.c",
++    "src/queue.h",
++    "src/strscpy.c",
++    "src/strscpy.h",
++    "src/threadpool.c",
++    "src/timer.c",
++    "src/uv-common.c",
++    "src/uv-common.h",
++    "src/uv-data-getter-setters.c",
++    "src/version.c",
++  ]
++
++  if (is_win) {
++    defines += [ "_GNU_SOURCE" ]
++    sources += [
++      "include/uv/win.h",
++      "src/win/async.c",
++      "src/win/atomicops-inl.h",
++      "src/win/core.c",
++      "src/win/detect-wakeup.c",
++      "src/win/dl.c",
++      "src/win/error.c",
++      "src/win/fs-event.c",
++      "src/win/fs.c",
++      "src/win/getaddrinfo.c",
++      "src/win/getnameinfo.c",
++      "src/win/handle-inl.h",
++      "src/win/handle.c",
++      "src/win/internal.h",
++      "src/win/loop-watcher.c",
++      "src/win/pipe.c",
++      "src/win/poll.c",
++      "src/win/process-stdio.c",
++      "src/win/process.c",
++      "src/win/req-inl.h",
++      "src/win/signal.c",
++      "src/win/snprintf.c",
++      "src/win/stream-inl.h",
++      "src/win/stream.c",
++      "src/win/tcp.c",
++      "src/win/thread.c",
++      "src/win/tty.c",
++      "src/win/udp.c",
++      "src/win/util.c",
++      "src/win/winapi.c",
++      "src/win/winapi.h",
++      "src/win/winsock.c",
++      "src/win/winsock.h",
++    ]
++    libs += [
++      "advapi32.lib",
++      "iphlpapi.lib",
++      "psapi.lib",
++      "shell32.lib",
++      "user32.lib",
++      "userenv.lib",
++      "ws2_32.lib",
++    ]
++  } else {
++    sources += [
++      "include/uv/aix.h",
++      "include/uv/bsd.h",
++      "include/uv/darwin.h",
++      "include/uv/linux.h",
++      "include/uv/sunos.h",
++      "include/uv/unix.h",
++      "src/unix/async.c",
++      "src/unix/atomic-ops.h",
++      "src/unix/core.c",
++      "src/unix/dl.c",
++      "src/unix/fs.c",
++      "src/unix/getaddrinfo.c",
++      "src/unix/getnameinfo.c",
++      "src/unix/internal.h",
++      "src/unix/loop-watcher.c",
++      "src/unix/loop.c",
++      "src/unix/pipe.c",
++      "src/unix/poll.c",
++      "src/unix/process.c",
++      "src/unix/pthread-fixes.c",
++      "src/unix/signal.c",
++      "src/unix/spinlock.h",
++      "src/unix/stream.c",
++      "src/unix/tcp.c",
++      "src/unix/thread.c",
++      "src/unix/tty.c",
++      "src/unix/udp.c",
++    ]
++    libs += [ "m" ]
++    ldflags += [ "-pthread" ]
++  }
++  if (is_mac || is_linux) {
++    sources += [ "src/unix/proctitle.c" ]
++  }
++  if (is_mac) {
++    sources += [
++      "src/unix/darwin-proctitle.c",
++      "src/unix/darwin.c",
++      "src/unix/fsevents.c",
++    ]
++    defines += [
++      "_DARWIN_USE_64_BIT_INODE=1",
++      "_DARWIN_UNLIMITED_SELECT=1",
++    ]
++  }
++  if (is_linux) {
++    defines += [ "_GNU_SOURCE" ]
++    sources += [
++      "src/unix/linux-core.c",
++      "src/unix/linux-inotify.c",
++      "src/unix/linux-syscalls.c",
++      "src/unix/linux-syscalls.h",
++      "src/unix/procfs-exepath.c",
++      "src/unix/sysinfo-loadavg.c",
++      "src/unix/sysinfo-memory.c",
++    ]
++    libs += [
++      "dl",
++      "rt",
++    ]
++  }
++  if (is_mac) {  # is_bsd
++    sources += [
++      "src/unix/bsd-ifaddrs.c",
++      "src/unix/kqueue.c",
++    ]
++  }
++  if (is_component_build && is_win) {
++    defines += [
++      "BUILDING_UV_SHARED=1",
++    ]
++  }
++}
+diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2eaaea76280
+--- /dev/null
++++ b/deps/zlib/BUILD.gn
+@@ -0,0 +1,58 @@
++config("includes") {
++  include_dirs = [ "." ]
++}
++
++config("ignored_warnings") {
++  if (is_win) {
++    cflags = [
++      "/wd4131",  # old-style declarator
++      "/wd4127",  # conditional expression is constant
++      "/wd4244",  # possible loss of data on type conversion
++      "/wd4996",  # deprecated 'open'
++    ]
++  } else {
++    cflags = [
++      "-Wno-implicit-function-declaration",
++      "-Wno-shift-negative-value",
++    ]
++  }
++}
++
++source_set("zlib") {
++  sources = [
++    "adler32.c",
++    "compress.c",
++    "crc32.c",
++    "crc32.h",
++    "deflate.c",
++    "deflate.h",
++    "gzclose.c",
++    "gzguts.h",
++    "gzlib.c",
++    "gzread.c",
++    "gzwrite.c",
++    "infback.c",
++    "inffast.c",
++    "inffast.h",
++    "inffixed.h",
++    "inflate.c",
++    "inflate.h",
++    "inftrees.c",
++    "inftrees.h",
++    "trees.c",
++    "trees.h",
++    "uncompr.c",
++    "zconf.h",
++    "zlib.h",
++    "zutil.c",
++    "zutil.h",
++  ]
++
++  if (is_win) {
++    defines = [ "ZLIB_DLL" ]
++  }
++
++  configs += [ ":ignored_warnings" ]
++
++  public_configs = [ ":includes" ]
++}
+diff --git a/filenames.json b/filenames.json
+new file mode 100644
+index 0000000000000000000000000000000000000000..615b82d3d78d63c8441172d65f008914756fdb7e
+--- /dev/null
++++ b/filenames.json
+@@ -0,0 +1,435 @@
++// This file is automatically generated by generate_gn_filenames_json.py
++// DO NOT EDIT
++{
++  "headers": [
++    {
++      "dest_dir": "include/node/",
++      "files": [
++        "src/js_native_api.h",
++        "src/js_native_api_types.h",
++        "src/node.h",
++        "src/node_api.h",
++        "src/node_api_types.h",
++        "src/node_buffer.h",
++        "src/node_object_wrap.h",
++        "src/node_version.h"
++      ]
++    },
++    {
++      "dest_dir": "include/node//",
++      "files": [
++        "//v8/include/v8-internal.h",
++        "//v8/include/v8-platform.h",
++        "//v8/include/v8-profiler.h",
++        "//v8/include/v8-testing.h",
++        "//v8/include/v8-util.h",
++        "//v8/include/v8-value-serializer-version.h",
++        "//v8/include/v8-version-string.h",
++        "//v8/include/v8-version.h",
++        "//v8/include/v8-wasm-trap-handler-posix.h",
++        "//v8/include/v8-wasm-trap-handler-win.h",
++        "//v8/include/v8.h",
++        "//v8/include/v8config.h"
++      ]
++    },
++    {
++      "dest_dir": "include/node//libplatform/",
++      "files": [
++        "//v8/include/libplatform/libplatform-export.h",
++        "//v8/include/libplatform/libplatform.h",
++        "//v8/include/libplatform/v8-tracing.h"
++      ]
++    },
++    {
++      "dest_dir": "include/node//uv/",
++      "files": [
++        "deps/uv/include/uv/aix.h",
++        "deps/uv/include/uv/android-ifaddrs.h",
++        "deps/uv/include/uv/bsd.h",
++        "deps/uv/include/uv/darwin.h",
++        "deps/uv/include/uv/errno.h",
++        "deps/uv/include/uv/linux.h",
++        "deps/uv/include/uv/os390.h",
++        "deps/uv/include/uv/posix.h",
++        "deps/uv/include/uv/stdint-msvc2008.h",
++        "deps/uv/include/uv/sunos.h",
++        "deps/uv/include/uv/threadpool.h",
++        "deps/uv/include/uv/tree.h",
++        "deps/uv/include/uv/unix.h",
++        "deps/uv/include/uv/version.h",
++        "deps/uv/include/uv/win.h"
++      ]
++    },
++    {
++      "dest_dir": "include/node//",
++      "files": [
++        "deps/uv/include/uv.h"
++      ]
++    }
++  ],
++  "library_files": [
++    "lib/internal/bootstrap/primordials.js",
++    "lib/internal/bootstrap/cache.js",
++    "lib/internal/bootstrap/loaders.js",
++    "lib/internal/bootstrap/node.js",
++    "lib/internal/bootstrap/pre_execution.js",
++    "lib/internal/per_context/setup.js",
++    "lib/internal/per_context/domexception.js",
++    "lib/async_hooks.js",
++    "lib/assert.js",
++    "lib/buffer.js",
++    "lib/child_process.js",
++    "lib/console.js",
++    "lib/constants.js",
++    "lib/crypto.js",
++    "lib/cluster.js",
++    "lib/dgram.js",
++    "lib/dns.js",
++    "lib/domain.js",
++    "lib/events.js",
++    "lib/fs.js",
++    "lib/http.js",
++    "lib/http2.js",
++    "lib/_http_agent.js",
++    "lib/_http_client.js",
++    "lib/_http_common.js",
++    "lib/_http_incoming.js",
++    "lib/_http_outgoing.js",
++    "lib/_http_server.js",
++    "lib/https.js",
++    "lib/inspector.js",
++    "lib/module.js",
++    "lib/net.js",
++    "lib/os.js",
++    "lib/path.js",
++    "lib/perf_hooks.js",
++    "lib/process.js",
++    "lib/punycode.js",
++    "lib/querystring.js",
++    "lib/readline.js",
++    "lib/repl.js",
++    "lib/stream.js",
++    "lib/_stream_readable.js",
++    "lib/_stream_writable.js",
++    "lib/_stream_duplex.js",
++    "lib/_stream_transform.js",
++    "lib/_stream_passthrough.js",
++    "lib/_stream_wrap.js",
++    "lib/string_decoder.js",
++    "lib/sys.js",
++    "lib/timers.js",
++    "lib/tls.js",
++    "lib/_tls_common.js",
++    "lib/_tls_wrap.js",
++    "lib/trace_events.js",
++    "lib/tty.js",
++    "lib/url.js",
++    "lib/util.js",
++    "lib/v8.js",
++    "lib/vm.js",
++    "lib/worker_threads.js",
++    "lib/zlib.js",
++    "lib/internal/assert.js",
++    "lib/internal/assert/assertion_error.js",
++    "lib/internal/async_hooks.js",
++    "lib/internal/buffer.js",
++    "lib/internal/cli_table.js",
++    "lib/internal/child_process.js",
++    "lib/internal/cluster/child.js",
++    "lib/internal/cluster/master.js",
++    "lib/internal/cluster/round_robin_handle.js",
++    "lib/internal/cluster/shared_handle.js",
++    "lib/internal/cluster/utils.js",
++    "lib/internal/cluster/worker.js",
++    "lib/internal/console/constructor.js",
++    "lib/internal/console/global.js",
++    "lib/internal/crypto/certificate.js",
++    "lib/internal/crypto/cipher.js",
++    "lib/internal/crypto/diffiehellman.js",
++    "lib/internal/crypto/hash.js",
++    "lib/internal/crypto/keygen.js",
++    "lib/internal/crypto/keys.js",
++    "lib/internal/crypto/pbkdf2.js",
++    "lib/internal/crypto/random.js",
++    "lib/internal/crypto/scrypt.js",
++    "lib/internal/crypto/sig.js",
++    "lib/internal/crypto/util.js",
++    "lib/internal/constants.js",
++    "lib/internal/dgram.js",
++    "lib/internal/dns/promises.js",
++    "lib/internal/dns/utils.js",
++    "lib/internal/dtrace.js",
++    "lib/internal/encoding.js",
++    "lib/internal/errors.js",
++    "lib/internal/error-serdes.js",
++    "lib/internal/fixed_queue.js",
++    "lib/internal/freelist.js",
++    "lib/internal/freeze_intrinsics.js",
++    "lib/internal/fs/promises.js",
++    "lib/internal/fs/read_file_context.js",
++    "lib/internal/fs/streams.js",
++    "lib/internal/fs/sync_write_stream.js",
++    "lib/internal/fs/utils.js",
++    "lib/internal/fs/watchers.js",
++    "lib/internal/http.js",
++    "lib/internal/idna.js",
++    "lib/internal/inspector_async_hook.js",
++    "lib/internal/js_stream_socket.js",
++    "lib/internal/linkedlist.js",
++    "lib/internal/main/check_syntax.js",
++    "lib/internal/main/eval_string.js",
++    "lib/internal/main/eval_stdin.js",
++    "lib/internal/main/inspect.js",
++    "lib/internal/main/print_bash_completion.js",
++    "lib/internal/main/print_help.js",
++    "lib/internal/main/prof_process.js",
++    "lib/internal/main/repl.js",
++    "lib/internal/main/run_main_module.js",
++    "lib/internal/main/run_third_party_main.js",
++    "lib/internal/main/worker_thread.js",
++    "lib/internal/modules/cjs/helpers.js",
++    "lib/internal/modules/cjs/loader.js",
++    "lib/internal/modules/esm/loader.js",
++    "lib/internal/modules/esm/create_dynamic_module.js",
++    "lib/internal/modules/esm/default_resolve.js",
++    "lib/internal/modules/esm/module_job.js",
++    "lib/internal/modules/esm/module_map.js",
++    "lib/internal/modules/esm/translators.js",
++    "lib/internal/net.js",
++    "lib/internal/options.js",
++    "lib/internal/policy/manifest.js",
++    "lib/internal/policy/sri.js",
++    "lib/internal/priority_queue.js",
++    "lib/internal/process/esm_loader.js",
++    "lib/internal/process/execution.js",
++    "lib/internal/process/main_thread_only.js",
++    "lib/internal/process/per_thread.js",
++    "lib/internal/process/policy.js",
++    "lib/internal/process/promises.js",
++    "lib/internal/process/stdio.js",
++    "lib/internal/process/warning.js",
++    "lib/internal/process/worker_thread_only.js",
++    "lib/internal/process/report.js",
++    "lib/internal/process/task_queues.js",
++    "lib/internal/profiler.js",
++    "lib/internal/querystring.js",
++    "lib/internal/readline.js",
++    "lib/internal/repl.js",
++    "lib/internal/repl/await.js",
++    "lib/internal/repl/history.js",
++    "lib/internal/repl/utils.js",
++    "lib/internal/socket_list.js",
++    "lib/internal/test/binding.js",
++    "lib/internal/timers.js",
++    "lib/internal/tls.js",
++    "lib/internal/trace_events_async_hooks.js",
++    "lib/internal/tty.js",
++    "lib/internal/url.js",
++    "lib/internal/util.js",
++    "lib/internal/util/comparisons.js",
++    "lib/internal/util/debuglog.js",
++    "lib/internal/util/inspect.js",
++    "lib/internal/util/inspector.js",
++    "lib/internal/util/types.js",
++    "lib/internal/http2/core.js",
++    "lib/internal/http2/compat.js",
++    "lib/internal/http2/util.js",
++    "lib/internal/v8_prof_polyfill.js",
++    "lib/internal/v8_prof_processor.js",
++    "lib/internal/validators.js",
++    "lib/internal/stream_base_commons.js",
++    "lib/internal/vm/source_text_module.js",
++    "lib/internal/worker.js",
++    "lib/internal/worker/io.js",
++    "lib/internal/streams/lazy_transform.js",
++    "lib/internal/streams/async_iterator.js",
++    "lib/internal/streams/buffer_list.js",
++    "lib/internal/streams/duplexpair.js",
++    "lib/internal/streams/legacy.js",
++    "lib/internal/streams/destroy.js",
++    "lib/internal/streams/state.js",
++    "lib/internal/streams/pipeline.js",
++    "lib/internal/streams/end-of-stream.js",
++    "deps/v8/tools/splaytree.js",
++    "deps/v8/tools/codemap.js",
++    "deps/v8/tools/consarray.js",
++    "deps/v8/tools/csvparser.js",
++    "deps/v8/tools/profile.js",
++    "deps/v8/tools/profile_view.js",
++    "deps/v8/tools/logreader.js",
++    "deps/v8/tools/arguments.js",
++    "deps/v8/tools/tickprocessor.js",
++    "deps/v8/tools/SourceMap.js",
++    "deps/v8/tools/tickprocessor-driver.js",
++    "deps/node-inspect/lib/_inspect.js",
++    "deps/node-inspect/lib/internal/inspect_client.js",
++    "deps/node-inspect/lib/internal/inspect_repl.js",
++    "deps/acorn/acorn/dist/acorn.js",
++    "deps/acorn/acorn-walk/dist/walk.js"
++  ],
++  "node_sources": [
++    "src/api/callback.cc",
++    "src/api/encoding.cc",
++    "src/api/environment.cc",
++    "src/api/exceptions.cc",
++    "src/api/hooks.cc",
++    "src/api/utils.cc",
++    "src/async_wrap.cc",
++    "src/cares_wrap.cc",
++    "src/connect_wrap.cc",
++    "src/connection_wrap.cc",
++    "src/debug_utils.cc",
++    "src/env.cc",
++    "src/fs_event_wrap.cc",
++    "src/handle_wrap.cc",
++    "src/heap_utils.cc",
++    "src/js_native_api.h",
++    "src/js_native_api_types.h",
++    "src/js_native_api_v8.cc",
++    "src/js_native_api_v8.h",
++    "src/js_native_api_v8_internals.h",
++    "src/js_stream.cc",
++    "src/module_wrap.cc",
++    "src/node.cc",
++    "src/node_api.cc",
++    "src/node_binding.cc",
++    "src/node_buffer.cc",
++    "src/node_config.cc",
++    "src/node_constants.cc",
++    "src/node_contextify.cc",
++    "src/node_credentials.cc",
++    "src/node_domain.cc",
++    "src/node_env_var.cc",
++    "src/node_errors.cc",
++    "src/node_file.cc",
++    "src/node_http_parser_llhttp.cc",
++    "src/node_http_parser_traditional.cc",
++    "src/node_http2.cc",
++    "src/node_i18n.cc",
++    "src/node_messaging.cc",
++    "src/node_metadata.cc",
++    "src/node_native_module.cc",
++    "src/node_options.cc",
++    "src/node_os.cc",
++    "src/node_perf.cc",
++    "src/node_platform.cc",
++    "src/node_postmortem_metadata.cc",
++    "src/node_process_events.cc",
++    "src/node_process_methods.cc",
++    "src/node_process_object.cc",
++    "src/node_serdes.cc",
++    "src/node_stat_watcher.cc",
++    "src/node_symbols.cc",
++    "src/node_task_queue.cc",
++    "src/node_trace_events.cc",
++    "src/node_types.cc",
++    "src/node_url.cc",
++    "src/node_util.cc",
++    "src/node_v8.cc",
++    "src/node_watchdog.cc",
++    "src/node_worker.cc",
++    "src/node_zlib.cc",
++    "src/pipe_wrap.cc",
++    "src/process_wrap.cc",
++    "src/sharedarraybuffer_metadata.cc",
++    "src/signal_wrap.cc",
++    "src/spawn_sync.cc",
++    "src/stream_base.cc",
++    "src/stream_pipe.cc",
++    "src/stream_wrap.cc",
++    "src/string_bytes.cc",
++    "src/string_decoder.cc",
++    "src/tcp_wrap.cc",
++    "src/timers.cc",
++    "src/tracing/agent.cc",
++    "src/tracing/node_trace_buffer.cc",
++    "src/tracing/node_trace_writer.cc",
++    "src/tracing/trace_event.cc",
++    "src/tracing/traced_value.cc",
++    "src/tty_wrap.cc",
++    "src/udp_wrap.cc",
++    "src/util.cc",
++    "src/uv.cc",
++    "src/aliased_buffer.h",
++    "src/async_wrap.h",
++    "src/async_wrap-inl.h",
++    "src/base_object.h",
++    "src/base_object-inl.h",
++    "src/base64.h",
++    "src/connect_wrap.h",
++    "src/connection_wrap.h",
++    "src/debug_utils.h",
++    "src/env.h",
++    "src/env-inl.h",
++    "src/handle_wrap.h",
++    "src/histogram.h",
++    "src/histogram-inl.h",
++    "src/http_parser_adaptor.h",
++    "src/js_stream.h",
++    "src/memory_tracker.h",
++    "src/memory_tracker-inl.h",
++    "src/module_wrap.h",
++    "src/node.h",
++    "src/node_api.h",
++    "src/node_api_types.h",
++    "src/node_binding.h",
++    "src/node_buffer.h",
++    "src/node_constants.h",
++    "src/node_context_data.h",
++    "src/node_contextify.h",
++    "src/node_errors.h",
++    "src/node_file.h",
++    "src/node_http_parser_impl.h",
++    "src/node_http2.h",
++    "src/node_http2_state.h",
++    "src/node_i18n.h",
++    "src/node_internals.h",
++    "src/node_messaging.h",
++    "src/node_metadata.h",
++    "src/node_mutex.h",
++    "src/node_native_module.h",
++    "src/node_object_wrap.h",
++    "src/node_options.h",
++    "src/node_options-inl.h",
++    "src/node_perf.h",
++    "src/node_perf_common.h",
++    "src/node_persistent.h",
++    "src/node_platform.h",
++    "src/node_process.h",
++    "src/node_revert.h",
++    "src/node_root_certs.h",
++    "src/node_stat_watcher.h",
++    "src/node_union_bytes.h",
++    "src/node_url.h",
++    "src/node_version.h",
++    "src/node_v8_platform-inl.h",
++    "src/node_watchdog.h",
++    "src/node_worker.h",
++    "src/pipe_wrap.h",
++    "src/req_wrap.h",
++    "src/req_wrap-inl.h",
++    "src/sharedarraybuffer_metadata.h",
++    "src/spawn_sync.h",
++    "src/stream_base.h",
++    "src/stream_base-inl.h",
++    "src/stream_pipe.h",
++    "src/stream_wrap.h",
++    "src/string_bytes.h",
++    "src/string_decoder.h",
++    "src/string_decoder-inl.h",
++    "src/string_search.h",
++    "src/tcp_wrap.h",
++    "src/tracing/agent.h",
++    "src/tracing/node_trace_buffer.h",
++    "src/tracing/node_trace_writer.h",
++    "src/tracing/trace_event.h",
++    "src/tracing/trace_event_common.h",
++    "src/tracing/traced_value.h",
++    "src/tty_wrap.h",
++    "src/udp_wrap.h",
++    "src/util.h",
++    "src/util-inl.h",
++    "deps/http_parser/http_parser.h",
++    "deps/v8/include/v8.h"
++  ]
++}
+diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
+new file mode 100644
+index 0000000000000000000000000000000000000000..0e1a5a22315989d5b0b4b6462330b3d693a43228
+--- /dev/null
++++ b/src/inspector/BUILD.gn
+@@ -0,0 +1,194 @@
++import("//v8/gni/v8.gni")
++
++inspector_protocol_dir = "../../tools/inspector_protocol"
++
++_protocol_generated = [
++  "protocol/Forward.h",
++  "protocol/Protocol.cpp",
++  "protocol/Protocol.h",
++  "protocol/NodeWorker.cpp",
++  "protocol/NodeWorker.h",
++  "protocol/NodeTracing.cpp",
++  "protocol/NodeTracing.h",
++]
++
++# These are from node_protocol_config.json
++# These convoluted path hacks are to work around the fact that node.js is very
++# confused about what paths are in its includes, without changing node at all.
++# Hopefully, keying everything in this file off the paths that are in
++# node_protocol_config.json will mean that the paths stay in sync.
++inspector_protocol_package = "src/node/inspector/protocol"
++inspector_protocol_output = "node/inspector/protocol"
++
++config("inspector_config") {
++  include_dirs = [
++    "$target_gen_dir",
++    "$target_gen_dir/src",
++  ]
++
++  configs = [ "../..:node_features" ]
++}
++
++source_set("inspector") {
++  sources = [
++    "main_thread_interface.cc",
++    "main_thread_interface.h",
++    "node_string.cc",
++    "node_string.h",
++    "tracing_agent.cc",
++    "tracing_agent.h",
++    "worker_agent.cc",
++    "worker_agent.h",
++    "worker_inspector.cc",
++    "worker_inspector.h",
++  ]
++  sources += rebase_path(_protocol_generated,
++                         ".",
++                         "$target_gen_dir/$inspector_protocol_package/..")
++  include_dirs = [
++    "//v8/include",
++    "..",
++  ]
++  deps = [
++    ":protocol_generated_sources",
++    ":v8_inspector_compress_protocol_json",
++    "../../deps/uv",
++    "//third_party/icu:icuuc",
++  ]
++  configs += [ "../..:node_internal_config" ]
++  public_configs = [ ":inspector_config" ]
++}
++
++# This based on the template from //v8/../inspector_protocol.gni
++action("protocol_generated_sources") {
++  # This is to ensure that the output directory exists--the code generator
++  # doesn't create it.
++  write_file("$target_gen_dir/$inspector_protocol_package/.dummy", "")
++  script = "$inspector_protocol_dir/code_generator.py"
++
++  inputs = [
++    "$target_gen_dir/node_protocol_config.json",
++    "$target_gen_dir/node_protocol.json",
++    "$inspector_protocol_dir/lib/Allocator_h.template",
++    "$inspector_protocol_dir/lib/Array_h.template",
++    "$inspector_protocol_dir/lib/Collections_h.template",
++    "$inspector_protocol_dir/lib/DispatcherBase_cpp.template",
++    "$inspector_protocol_dir/lib/DispatcherBase_h.template",
++    "$inspector_protocol_dir/lib/ErrorSupport_cpp.template",
++    "$inspector_protocol_dir/lib/ErrorSupport_h.template",
++    "$inspector_protocol_dir/lib/Forward_h.template",
++    "$inspector_protocol_dir/lib/FrontendChannel_h.template",
++    "$inspector_protocol_dir/lib/Maybe_h.template",
++    "$inspector_protocol_dir/lib/Object_cpp.template",
++    "$inspector_protocol_dir/lib/Object_h.template",
++    "$inspector_protocol_dir/lib/Parser_cpp.template",
++    "$inspector_protocol_dir/lib/Parser_h.template",
++    "$inspector_protocol_dir/lib/Protocol_cpp.template",
++    "$inspector_protocol_dir/lib/ValueConversions_h.template",
++    "$inspector_protocol_dir/lib/Values_cpp.template",
++    "$inspector_protocol_dir/lib/Values_h.template",
++    "$inspector_protocol_dir/templates/Exported_h.template",
++    "$inspector_protocol_dir/templates/Imported_h.template",
++    "$inspector_protocol_dir/templates/TypeBuilder_cpp.template",
++    "$inspector_protocol_dir/templates/TypeBuilder_h.template",
++  ]
++
++  deps = [
++    ":node_protocol_config",
++    ":node_protocol_json",
++  ]
++
++  args = [
++    "--jinja_dir",
++    rebase_path("//third_party/", root_build_dir),  # jinja is in chromium's third_party
++    "--output_base",
++    rebase_path("$target_gen_dir/src", root_build_dir),
++    "--config",
++    rebase_path("$target_gen_dir/node_protocol_config.json", root_build_dir),
++  ]
++
++  outputs =
++      get_path_info(rebase_path(rebase_path(_protocol_generated,
++                                            ".",
++                                            "$inspector_protocol_output/.."),
++                                ".",
++                                "$target_gen_dir/src"),
++                    "abspath")
++}
++
++template("generate_protocol_json") {
++  copy_target_name = target_name + "_copy"
++  copy(copy_target_name) {
++    sources = invoker.sources
++    outputs = [
++      "$target_gen_dir/{{source_file_part}}",
++    ]
++  }
++  copied_pdl = get_target_outputs(":$copy_target_name")
++  action(target_name) {
++    deps = [
++      ":$copy_target_name",
++    ]
++    sources = copied_pdl
++    outputs = invoker.outputs
++    script = "//v8/third_party/inspector_protocol/convert_protocol_to_json.py"
++    args = rebase_path(sources + outputs, root_build_dir)
++  }
++}
++
++copy("node_protocol_config") {
++  sources = [
++    "node_protocol_config.json",
++  ]
++  outputs = [
++    "$target_gen_dir/{{source_file_part}}",
++  ]
++}
++
++generate_protocol_json("node_protocol_json") {
++  sources = [
++    "node_protocol.pdl",
++  ]
++  outputs = [
++    "$target_gen_dir/node_protocol.json",
++  ]
++}
++
++generate_protocol_json("v8_protocol_json") {
++  sources = [
++    "//v8/src/inspector/js_protocol.pdl",
++  ]
++  outputs = [
++    "$target_gen_dir/js_protocol.json",
++  ]
++}
++
++action("concatenate_protocols") {
++  deps = [
++    ":node_protocol_json",
++    ":v8_protocol_json",
++  ]
++  inputs = [
++    "$target_gen_dir/js_protocol.json",
++    "$target_gen_dir/node_protocol.json",
++  ]
++  outputs = [
++    "$target_gen_dir/concatenated_protocol.json",
++  ]
++  script = "//v8/third_party/inspector_protocol/concatenate_protocols.py"
++  args = rebase_path(inputs + outputs, root_build_dir)
++}
++
++action("v8_inspector_compress_protocol_json") {
++  deps = [
++    ":concatenate_protocols",
++  ]
++  inputs = [
++    "$target_gen_dir/concatenated_protocol.json",
++  ]
++  outputs = [
++    "$target_gen_dir/v8_inspector_protocol_json.h",
++  ]
++  script = "../../tools/compress_json.py"
++  args = rebase_path(inputs + outputs, root_build_dir)
++}
+diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py
+new file mode 100644
+index 0000000000000000000000000000000000000000..01f62d4ae6e3b9d539444e3dff069f0011353caa
+--- /dev/null
++++ b/tools/generate_config_gypi.py
+@@ -0,0 +1,11 @@
++# TODO: assess which if any of the config variables are important to include in
++# the js2c'd config.gypi.
++import sys
++
++def main(args):
++  out = args[0]
++  with open(out, 'w') as f:
++    f.write("{'variables':{}}\n")
++
++if __name__ == '__main__':
++  main(sys.argv[1:])
+diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
+new file mode 100755
+index 0000000000000000000000000000000000000000..28e97bcb9aed0a8c0bbfa0e00ba914aa923d4bba
+--- /dev/null
++++ b/tools/generate_gn_filenames_json.py
+@@ -0,0 +1,63 @@
++#!/usr/bin/env python
++import json
++import os
++import sys
++
++import install
++
++
++def LoadPythonDictionary(path):
++  file_string = open(path).read()
++  try:
++    file_data = eval(file_string, {'__builtins__': None}, None)
++  except SyntaxError, e:
++    e.filename = path
++    raise
++  except Exception, e:
++    raise Exception("Unexpected error while reading %s: %s" % (path, str(e)))
++
++  assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path
++
++  return file_data
++
++
++FILENAMES_JSON_HEADER = '''
++// This file is automatically generated by generate_gn_filenames_json.py
++// DO NOT EDIT
++'''.lstrip()
++
++
++if __name__ == '__main__':
++  node_root_dir = os.path.dirname(os.path.dirname(__file__))
++  node_gyp_path = os.path.join(node_root_dir, 'node.gyp')
++  out = {}
++  node_gyp = LoadPythonDictionary(node_gyp_path)
++  out['library_files'] = node_gyp['variables']['library_files']
++  node_lib_target = next(
++      t for t in node_gyp['targets']
++      if t['target_name'] == '<(node_lib_target_name)')
++  node_source_blacklist = {
++      '<@(library_files)',
++      'common.gypi',
++      '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
++  }
++  out['node_sources'] = [
++      f for f in node_lib_target['sources']
++      if f not in node_source_blacklist]
++
++  out['headers'] = []
++
++  def add_headers(files, dest_dir):
++    if 'src/node.h' in files:
++      files = [f for f in files if f.endswith('.h')]
++    elif any(f.startswith('deps/v8/') for f in files):
++      files = [f.replace('deps/v8/', '//v8/', 1) for f in files]
++    hs = {'files': sorted(files), 'dest_dir': dest_dir}
++    out['headers'].append(hs)
++
++  install.variables = {'node_shared_libuv': 'false'}
++  install.headers(add_headers)
++  with open(os.path.join(node_root_dir, 'filenames.json'), 'w') as f:
++    f.write(FILENAMES_JSON_HEADER)
++    f.write(json.dumps(out, sort_keys=True, indent=2, separators=(',', ': ')))
++    f.write('\n')
+diff --git a/tools/inspector_protocol/inspector_protocol.gni b/tools/inspector_protocol/inspector_protocol.gni
+index 5dcc1f522d863492b28d6d5c35d2232a08d26fe8..8909c5f7557fd58e4cbd0950e3f071d5224fd9c5 100644
+--- a/tools/inspector_protocol/inspector_protocol.gni
++++ b/tools/inspector_protocol/inspector_protocol.gni
+@@ -27,7 +27,7 @@ template("inspector_protocol_generate") {
+   inspector_protocol_dir = invoker.inspector_protocol_dir
+ 
+   action(target_name) {
+-    script = "$inspector_protocol_dir/CodeGenerator.py"
++    script = "$inspector_protocol_dir/code_generator.py"
+ 
+     inputs = [
+       invoker.config_file,
+diff --git a/tools/inspector_protocol/inspector_protocol.gypi b/tools/inspector_protocol/inspector_protocol.gypi
+index 1fb7119b5fa567535b01d040e2fb003a5ed7cdee..f206310828dd39d625f65cdb8632c7f78e973baa 100644
+--- a/tools/inspector_protocol/inspector_protocol.gypi
++++ b/tools/inspector_protocol/inspector_protocol.gypi
+@@ -27,7 +27,7 @@
+       'templates/Imported_h.template',
+       'templates/TypeBuilder_cpp.template',
+       'templates/TypeBuilder_h.template',
+-      'CodeGenerator.py',
++      'code_generator.py',
+     ]
+   }
+ }
+diff --git a/tools/js2c.py b/tools/js2c.py
+index eff44940c57ec6f898025716ea057f3b38d488ea..5e8a243070fcd8767a9689bcf8e95e55c3c99941 100755
+--- a/tools/js2c.py
++++ b/tools/js2c.py
+@@ -267,6 +267,13 @@ def JS2C(source, target):
+         split = split[1:]
+       name = '/'.join(split)
+ 
++    # Electron-specific: when driving the node build from Electron, we generate
++    # config.gypi in a separate directory and pass the absolute path to js2c.
++    # This overrides the absolute path so that the variable names in the
++    # generated C are as if it was in the root node directory.
++    if name.endswith("/config.gypi"):
++      name = "config.gypi"
++
+     # if its a gypi file we're going to want it as json
+     # later on anyway, so get it out of the way now
+     if name.endswith('.gypi'):
+diff --git a/tools/tar.py b/tools/tar.py
+new file mode 100644
+index 0000000000000000000000000000000000000000..eb697be25779db62c829aac45a509804e9fff331
+--- /dev/null
++++ b/tools/tar.py
+@@ -0,0 +1,12 @@
++import os
++import sys
++import tarfile
++
++source = sys.argv[1]
++target = sys.argv[2]
++
++os.chdir(os.path.dirname(source))
++
++tarball = tarfile.open(name=os.path.basename(target), mode='w:gz')
++tarball.add(os.path.relpath(source))
++tarball.close()

+ 159 - 0
patches/common/node/build_allow_embedders_to_override_the_node_module_version_define.patch

@@ -0,0 +1,159 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Tue, 16 Apr 2019 15:12:14 -0700
+Subject: build: allow embedders to override the NODE_MODULE_VERSION define
+
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 028b0ae16ffac1fc89128f2f994680923a500a36..b5912d4d671db27761be4c6283ed5e21818c5b04 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -37,6 +37,9 @@ declare_args() {
+   # `sourceUrl` and `headersUrl`. When compiling a release build, this will
+   # default to https://nodejs.org/download/release/')
+   node_release_urlbase = ""
++
++  # Allows embedders to override the NODE_MODULE_VERSION define
++  node_module_version = ""
+ }
+ 
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+@@ -145,6 +148,9 @@ config("node_internal_config") {
+     "NODE_WANT_INTERNALS=1",
+     "NODE_IMPLEMENTATION",
+   ]
++  if (node_module_version != "") {
++    defines += [ "NODE_MODULE_VERSION=" + node_module_version ]
++  }
+   if (is_component_build) {
+     defines += [
+       "BUILDING_V8_SHARED",
+@@ -200,14 +206,14 @@ config("node_internal_config") {
+ component("node_lib") {
+   deps = [
+     ":node_js2c",
+-    "//third_party/brotli:enc",
+-    "//third_party/brotli:dec",
+     "deps/cares",
+     "deps/histogram",
+     "deps/http_parser",
+     "deps/llhttp",
+     "deps/nghttp2",
+     "deps/zlib",
++    "//third_party/brotli:dec",
++    "//third_party/brotli:enc",
+     "//v8:v8_libplatform",
+   ]
+   public_deps = [
+@@ -255,8 +261,8 @@ component("node_lib") {
+       "src/inspector_agent.h",
+       "src/inspector_io.cc",
+       "src/inspector_io.h",
+-      "src/inspector_profiler.cc",
+       "src/inspector_js_api.cc",
++      "src/inspector_profiler.cc",
+       "src/inspector_socket.cc",
+       "src/inspector_socket.h",
+       "src/inspector_socket_server.cc",
+@@ -323,6 +329,20 @@ copy("node_gypi_headers") {
+   ]
+ }
+ 
++action("node_version_header") {
++  inputs = [
++    "src/node_version.h",
++  ]
++  outputs = [
++    "$node_headers_dir/include/node/node_version.h",
++  ]
++  script = "tools/generate_node_version_header.py"
++  args = [ rebase_path("src/node_version.h"), rebase_path(outputs[0]) ]
++  if (node_module_version != "") {
++    args += [ "$node_module_version" ]
++  }
++}
++
+ action("tar_headers") {
+   deps = [
+     ":copy_headers",
+@@ -341,6 +361,7 @@ group("copy_headers") {
+   public_deps = header_groups + [
+                   ":zlib_headers",
+                   ":node_gypi_headers",
++                  ":node_version_header",
+                 ]
+ }
+ 
+diff --git a/filenames.json b/filenames.json
+index 615b82d3d78d63c8441172d65f008914756fdb7e..86d89280e74d7365ab2782517fb779fc072bf0bf 100644
+--- a/filenames.json
++++ b/filenames.json
+@@ -11,8 +11,7 @@
+         "src/node_api.h",
+         "src/node_api_types.h",
+         "src/node_buffer.h",
+-        "src/node_object_wrap.h",
+-        "src/node_version.h"
++        "src/node_object_wrap.h"
+       ]
+     },
+     {
+diff --git a/src/node_version.h b/src/node_version.h
+index ac2a13fe2db8d9ee03f620fbbd0afb68c33784f2..0cfa3e471f541e9241478f32fda8bdb640929b59 100644
+--- a/src/node_version.h
++++ b/src/node_version.h
+@@ -117,7 +117,10 @@
+  *
+  * More information can be found at https://nodejs.org/en/download/releases/
+  */
++// Electron sets NODE_MODULE_VERSION in their GN configuration
++#ifndef NODE_MODULE_VERSION
+ #define NODE_MODULE_VERSION 72
++#endif
+ 
+ // the NAPI_VERSION provided by this version of the runtime
+ #define NAPI_VERSION  4
+diff --git a/tools/generate_gn_filenames_json.py b/tools/generate_gn_filenames_json.py
+index 28e97bcb9aed0a8c0bbfa0e00ba914aa923d4bba..41f0138dfa9f610de1f8267080fa15e8bd9e0325 100755
+--- a/tools/generate_gn_filenames_json.py
++++ b/tools/generate_gn_filenames_json.py
+@@ -49,7 +49,7 @@ if __name__ == '__main__':
+ 
+   def add_headers(files, dest_dir):
+     if 'src/node.h' in files:
+-      files = [f for f in files if f.endswith('.h')]
++      files = [f for f in files if f.endswith('.h') and f != 'src/node_version.h']
+     elif any(f.startswith('deps/v8/') for f in files):
+       files = [f.replace('deps/v8/', '//v8/', 1) for f in files]
+     hs = {'files': sorted(files), 'dest_dir': dest_dir}
+diff --git a/tools/generate_node_version_header.py b/tools/generate_node_version_header.py
+new file mode 100755
+index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2eee17e941
+--- /dev/null
++++ b/tools/generate_node_version_header.py
+@@ -0,0 +1,25 @@
++#!/usr/bin/env python
++import re
++import sys
++
++node_version_file = sys.argv[1]
++out_file = sys.argv[2]
++NMV = None
++if len(sys.argv) > 3:
++  NMV = sys.argv[3]
++
++with open(node_version_file, 'r') as in_file, open(out_file, 'w') as out_file:
++  changed = False
++  contents = in_file.read()
++  new_contents = re.sub(
++    r'^#define NODE_MODULE_VERSION [0-9]+$',
++    '#define NODE_MODULE_VERSION ' + NMV,
++    contents,
++    flags=re.MULTILINE)
++
++  changed = contents != new_contents
++
++  if not changed and NMV is not None:
++    raise Exception("Did not modify the NMV from nodes value, this value MUST differ from node")
++
++  out_file.writelines(new_contents)

+ 23 - 0
patches/common/node/call_process_log_from_fallback_stream_on_windows.patch

@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kevin Sawicki <[email protected]>
+Date: Wed, 12 Oct 2016 09:43:26 -0700
+Subject: Call process.log from fallback stream on Windows
+
+(cherry picked from commit d31e629b4f2daf3500a485caab2b2990a41e3ad4)
+
+diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js
+index 385225cabc402ee3d65b1295f24abb0bc0058166..b1b18196c181ad6edcba545282512f9131c99184 100644
+--- a/lib/internal/process/stdio.js
++++ b/lib/internal/process/stdio.js
+@@ -195,6 +195,11 @@ function createWritableStdioStream(fd) {
+       const { Writable } = require('stream');
+       stream = new Writable({
+         write(buf, enc, cb) {
++          if (process.platform === 'win32' &&
++              process.env.ELECTRON_RUN_AS_NODE &&
++              !process.env.ELECTRON_NO_ATTACH_CONSOLE) {
++            process.log(buf.toString());
++          }
+           cb();
+         }
+       });

+ 62 - 0
patches/common/node/chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch

@@ -0,0 +1,62 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Wed, 22 May 2019 13:34:18 -0700
+Subject: chore: add ability to prevent / warn non context-aware native modules
+ being loaded
+
+diff --git a/src/env.h b/src/env.h
+index 4fac6149a6befa32c796d7194824d48a48e07958..3a88ba64f82e16dd5507edfb015dd6c0fecdb7e6 100644
+--- a/src/env.h
++++ b/src/env.h
+@@ -756,6 +756,15 @@ class Environment {
+               uint64_t thread_id = kNoThreadId);
+   ~Environment();
+ 
++  void ForceOnlyContextAwareNativeModules() {
++    force_context_aware_ = true;
++  }
++  void WarnNonContextAwareNativeModules() {
++    warn_non_context_aware_ = true;
++  }
++  bool force_context_aware() { return force_context_aware_; }
++  bool warn_non_context_aware() { return warn_non_context_aware_; }
++
+   void InitializeLibuv(bool start_profiler_idle_notifier);
+   v8::MaybeLocal<v8::Object> ProcessCliArgs(
+       const std::vector<std::string>& args,
+@@ -1085,6 +1094,9 @@ class Environment {
+   inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
+                          const char* errmsg);
+ 
++  bool force_context_aware_ = false;
++  bool warn_non_context_aware_ = false;
++
+   ExecutionMode execution_mode_ = ExecutionMode::kDefault;
+   std::list<binding::DLib> loaded_addons_;
+   v8::Isolate* const isolate_;
+diff --git a/src/node_binding.cc b/src/node_binding.cc
+index 123bdad418e4464c0c6866086ecc337144f710b0..c0549175e723b5efabf414ed023dffd03299489f 100644
+--- a/src/node_binding.cc
++++ b/src/node_binding.cc
+@@ -1,6 +1,7 @@
+ #include "node_binding.h"
+ #include "env-inl.h"
+ #include "node_native_module.h"
++#include "node_process.h"
+ #include "util.h"
+ #include <atomic>
+ 
+@@ -469,6 +470,13 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
+     }
+ 
+     if (mp != nullptr) {
++      if (mp->nm_context_register_func == nullptr) {
++        if (env->force_context_aware()) {
++          env->ThrowError("Loading non context-aware native modules has been disabled in this process.  This means you have loaded a non context-aware native module with app.allowRendererProcessReuse set to true. See https://github.com/electron/electron/issues/18397 for more information");
++        } else if (env->warn_non_context_aware()) {
++          ProcessEmitWarningGeneric(env, "Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information", "Electron");
++        }
++      }
+       mp->nm_dso_handle = dlib->handle_;
+       dlib->SaveInGlobalHandleMap(mp);
+     } else {

+ 49 - 0
patches/common/node/chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch

@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Mon, 3 Jun 2019 01:05:58 -0700
+Subject: chore: allow the node entrypoint to be a builtin module
+
+This floats two patches onto the node 12 branch that I don't think we can upstream.
+
+#### `run_main_module.js`
+
+The default behavior of node is to `path.resolve(firstArg)` to figure out what JS file to load.  Issue here is that we use that for `browser/init.js` which now doesn't exist on disk.  This adds an exception that won't affect user code to allow node to boot-up internal modules (in this case anything in the `electron/js2c` scope.
+
+#### `loader.js`
+
+Similar to the above, the loader uses `process.argv[1]` to figure out when to break for `--inspect-brk` this updates the logic to use an Electron provided `process._firstFileName`
+
+diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js
+index 634abe493ea60e5e3eecb9c6125226fa0b7c36d6..84f4ced91d58dfb7b7031adf0b5ac99861b4a75e 100644
+--- a/lib/internal/main/run_main_module.js
++++ b/lib/internal/main/run_main_module.js
+@@ -5,8 +5,11 @@ const {
+ } = require('internal/bootstrap/pre_execution');
+ 
+ // Expand process.argv[1] into a full path.
++// Allow direct module name loads if it is a built-in electron module
++if (!process.argv[1] || !process.argv[1].startsWith('electron/js2c')) {
+ const path = require('path');
+ process.argv[1] = path.resolve(process.argv[1]);
++}
+ 
+ prepareMainThreadExecution();
+ 
+diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
+index f5ee6436a63ad6bd93688a3db74986c9d20343ba..3660a4d82dd129c5e6778151a2647e840baaffc0 100644
+--- a/lib/internal/modules/cjs/loader.js
++++ b/lib/internal/modules/cjs/loader.js
+@@ -805,6 +805,13 @@ Module.prototype._compile = function(content, filename) {
+   if (process._breakFirstLine && process._eval == null) {
+     if (!resolvedArgv) {
+       // We enter the repl if we're not given a filename argument.
++      // process._firstFileName is used by Embedders to tell node what
++      // the first "real" file is when they use themselves as the entry
++      // point
++      if (process._firstFileName) {
++        resolvedArgv = process._firstFileName
++        delete process._firstFileName
++      } else
+       if (process.argv[1]) {
+         resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
+       } else {

+ 19 - 0
patches/common/node/export_environment_knodecontexttagptr.patch

@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Apthorp <[email protected]>
+Date: Tue, 2 Oct 2018 17:09:15 -0700
+Subject: export Environment::kNodeContextTagPtr
+
+
+diff --git a/src/env.h b/src/env.h
+index f22d57171d9d315e088151a7a3df825933cfd303..4fac6149a6befa32c796d7194824d48a48e07958 100644
+--- a/src/env.h
++++ b/src/env.h
+@@ -1140,7 +1140,7 @@ class Environment {
+   uint64_t thread_id_;
+   std::unordered_set<worker::Worker*> sub_worker_contexts_;
+ 
+-  static void* const kNodeContextTagPtr;
++  NODE_EXTERN static void* const kNodeContextTagPtr;
+   static int const kNodeContextTag;
+ 
+ #if HAVE_INSPECTOR

+ 22 - 0
patches/common/node/export_nativemodule.patch

@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Sun, 27 Mar 2016 14:43:14 +0900
+Subject: Export NativeModule
+
+This is used by atom for doing module compile cache.
+
+(cherry picked from commit 83b45fddb9a36c1376f7a2b5c70717e37b6f0133)
+
+diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
+index ced530a4ce161dfbe130b752161d5c8866b5d3f5..0541382a0dc10ba97da7cfa4d8ef5a6b12f511c0 100644
+--- a/lib/internal/bootstrap/loaders.js
++++ b/lib/internal/bootstrap/loaders.js
+@@ -170,6 +170,8 @@ NativeModule.exposeInternals = function() {
+   }
+ };
+ 
++process.NativeModule = NativeModule;
++
+ const {
+   moduleIds,
+   compileFunction

+ 23 - 0
patches/common/node/expose_get_builtin_module_function.patch

@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Thiago de Arruda <[email protected]>
+Date: Mon, 6 Mar 2017 10:42:34 -0300
+Subject: Expose `get_builtin_module` function
+
+This is a requirement for electron/electron#8815, which exposes some builtin
+modules to sandboxed renderers.
+
+(cherry picked from commit 4c058a6cb5331eef1c7f51c042dd074a2d4f9234)
+
+diff --git a/src/node_binding.h b/src/node_binding.h
+index dd94fab36a0e8fcb453ba82091f6284e8193c00d..b2aa45b7e85127f645f43d5fce0050fd488f2668 100644
+--- a/src/node_binding.h
++++ b/src/node_binding.h
+@@ -93,6 +93,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);
+ 
++NODE_EXTERN node_module* get_linked_module(const char *name);
++
+ }  // namespace binding
+ 
+ }  // namespace node

+ 139 - 0
patches/common/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch

@@ -0,0 +1,139 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Thu, 13 Sep 2018 08:42:22 -0700
+Subject: feat: add flags for low-level hooks and exceptions
+
+This commit adds two new exposed methods to `node.cc`, `InitGeneric` and
+`LoadEnvironmentGeneric` that allow for control of which mode Node
+should run, which i have called `standalone_mode` and
+`upstream_node_mode`. Default behavior of `Init` and `LoadEnvironment`
+remain the same.
+
+We have 3 modes when running Node in Electron:
+1. In the main process, we want to have a full Node environment, but
+with signal handlers and other low level things disabled
+2. In renderer process, we want Node to reuse the web page's context
+3. In `ELECTRON_RUN_AS_NODE`, we want Node to run as it runs officially
+by default
+
+For modes 1 and 3, we have Node create a new V8 context with a Node
+Environment on it. However, for mode 2, since the V8 context is created
+by blink for web frames and web workers we make Node create the Node
+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/api/environment.cc b/src/api/environment.cc
+index 2ecf4029909c7e97444458998fa1d961676b8786..8aa3d1b174bcdd21602c3b695dfa97705b50daad 100644
+--- a/src/api/environment.cc
++++ b/src/api/environment.cc
+@@ -45,7 +45,7 @@ static bool ShouldAbortOnUncaughtException(Isolate* isolate) {
+          !env->inside_should_not_abort_on_uncaught_scope();
+ }
+ 
+-static void OnMessage(Local<Message> message, Local<Value> error) {
++void OnMessage(Local<Message> message, Local<Value> error) {
+   Isolate* isolate = message->GetIsolate();
+   switch (message->ErrorLevel()) {
+     case Isolate::MessageErrorLevel::kMessageWarning: {
+diff --git a/src/env.cc b/src/env.cc
+index 46f807a3c4fe3ce2c7509d098361b470152495e5..7160e69e02559c3c7c27af2688b6a9989e28e87a 100644
+--- a/src/env.cc
++++ b/src/env.cc
+@@ -231,6 +231,12 @@ Environment::Environment(IsolateData* isolate_data,
+   if (options_->no_force_async_hooks_checks) {
+     async_hooks_.no_force_checks();
+   }
++
++  // TODO(addaleax): the per-isolate state should not be controlled by
++  // a single Environment.
++  if (g_standalone_mode) {
++    isolate()->SetPromiseRejectCallback(task_queue::PromiseRejectCallback);
++  }
+ }
+ 
+ CompileFnEntry::CompileFnEntry(Environment* env, uint32_t id)
+diff --git a/src/node.cc b/src/node.cc
+index deb4246d357539459fcc3524fcddb9a8f58edfa0..6f07d07a7bc3dc21b777d29aad0def17cd889bbc 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -143,6 +143,9 @@ using v8::Undefined;
+ using v8::V8;
+ using v8::Value;
+ 
++bool g_standalone_mode = true;
++bool g_upstream_node_mode = true;
++
+ namespace per_process {
+ 
+ // node_revert.h
+@@ -236,6 +239,12 @@ static MaybeLocal<Value> ExecuteBootstrapper(
+ 
+ MaybeLocal<Value> RunBootstrapping(Environment* env) {
+   CHECK(!env->has_run_bootstrapping_code());
++  if (g_standalone_mode) {
++    env->isolate()->AddMessageListener(OnMessage);
++  }
++  if (g_upstream_node_mode) {
++    env->isolate()->SetFatalErrorHandler(OnFatalError);
++  }
+ 
+   EscapableHandleScope scope(env->isolate());
+   Isolate* isolate = env->isolate();
+@@ -641,7 +650,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+   binding::RegisterBuiltinModules();
+ 
+   // Make inherited handles noninheritable.
+-  uv_disable_stdio_inheritance();
++  if (g_upstream_node_mode) {
++    uv_disable_stdio_inheritance();
++  }
+ 
+ #ifdef NODE_REPORT
+   // Cache the original command line to be
+@@ -705,6 +716,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+   }
+ #endif
+ 
++  if (g_upstream_node_mode) {
++  // NOTE(jeremy): indentation is intentionally wrong here, to ease rebasing.
++
+   const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false);
+   if (exit_code != 0) return exit_code;
+ 
+@@ -727,6 +741,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+   per_process::metadata.versions.InitializeIntlVersions();
+ #endif
+ 
++  }  // g_upstream_node_mode
++
+   // We should set node_is_initialized here instead of in node::Start,
+   // otherwise embedders using node::Init to initialize everything will not be
+   // able to set it and native modules will not load for them.
+diff --git a/src/node.h b/src/node.h
+index 32fd4b288e75f37dad8660114f4eca506d61b3fa..070abc5be387244484d8cdbb193dc5d7709674fd 100644
+--- a/src/node.h
++++ b/src/node.h
+@@ -203,6 +203,9 @@ namespace node {
+ 
+ class IsolateData;
+ class Environment;
++// Whether node should open some low level hooks.
++NODE_EXTERN extern bool g_standalone_mode;
++NODE_EXTERN extern bool g_upstream_node_mode;
+ 
+ // TODO(addaleax): Officially deprecate this and replace it with something
+ // better suited for a public embedder API.
+diff --git a/src/node_internals.h b/src/node_internals.h
+index 1ffe78d33b19a098e9200271a8e809205d8f540b..aff9a9a99397575fd6aba4105ed70aef5c646963 100644
+--- a/src/node_internals.h
++++ b/src/node_internals.h
+@@ -190,6 +190,8 @@ static v8::MaybeLocal<v8::Object> New(Environment* env,
+ }
+ }  // namespace Buffer
+ 
++void OnMessage(v8::Local<v8::Message> message, v8::Local<v8::Value> error);
++
+ v8::MaybeLocal<v8::Value> InternalMakeCallback(
+     Environment* env,
+     v8::Local<v8::Object> recv,

+ 19 - 0
patches/common/node/feat_add_new_built_with_electron_variable_to_config_gypi.patch

@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Tue, 2 Oct 2018 11:39:58 -0700
+Subject: feat: add new built_with_electron variable to config.gypi
+
+
+diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py
+index 01f62d4ae6e3b9d539444e3dff069f0011353caa..d8b279f590c115108d5dca879747de7b0c9f1934 100644
+--- a/tools/generate_config_gypi.py
++++ b/tools/generate_config_gypi.py
+@@ -5,7 +5,7 @@ import sys
+ def main(args):
+   out = args[0]
+   with open(out, 'w') as f:
+-    f.write("{'variables':{}}\n")
++    f.write("{'variables':{'built_with_electron': 1}}\n")
+ 
+ if __name__ == '__main__':
+   main(sys.argv[1:])

+ 27 - 0
patches/common/node/feat_add_original-fs_module.patch

@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Thu, 11 Apr 2019 17:16:13 +0900
+Subject: feat: add original-fs module
+
+
+diff --git a/tools/js2c.py b/tools/js2c.py
+index 5e8a243070fcd8767a9689bcf8e95e55c3c99941..f11604d53768d83fd3320a407245faf8390d3b72 100755
+--- a/tools/js2c.py
++++ b/tools/js2c.py
+@@ -287,6 +287,16 @@ def JS2C(source, target):
+       definitions.append(definition)
+     else:
+       AddModule(name.split('.', 1)[0], lines)
++      # Electron: Expose fs module without asar support.
++      if name == 'fs.js':
++        # Node's 'fs' and 'internal/fs/streams' have a lazy-loaded circular
++        # dependency. So to expose the unmodified Node 'fs' functionality here,
++        # we have to copy both 'fs' *and* 'internal/fs/streams' and modify the
++        # copies to depend on each other instead of on our asarified 'fs' code.
++        # See https://github.com/electron/electron/pull/16028 for more.
++        AddModule('original-fs', lines.replace("require('internal/fs/streams')", "require('original-fs/streams')"))
++      elif name == 'internal/fs/streams.js':
++        AddModule('original-fs/streams', lines.replace("require('fs')", "require('original-fs')"))
+ 
+   # Emit result
+   output = open(str(target[0]), "w")

+ 59 - 0
patches/common/node/feat_add_uv_loop_watcher_queue_code.patch

@@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Mon, 30 Jul 2018 10:34:54 -0700
+Subject: feat: add uv_loop watcher_queue code
+
+Electron's Node Integration works by listening to Node's backend file descriptor in a separate thread; when an event is ready the backend file descriptor will trigger a new event for it, and the main thread will then iterate the libuv loop. For certain operations (ex. adding a timeout task) the backend file descriptor isn't informed, & as a result the main thread doesn't know it needs to iterate the libuv loop so the timeout task will never execute until something else trigger a new event. This commit should be removed when https://github.com/libuv/libuv/pull/1921 is merged
+
+diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
+index 43895ac80dd6703f10b28717cf5ab81a7f803f5f..9de2bcdd15869e36ec9ce652c590eef5fc8a0b9d 100644
+--- a/deps/uv/include/uv.h
++++ b/deps/uv/include/uv.h
+@@ -1626,6 +1626,8 @@ union uv_any_req {
+ struct uv_loop_s {
+   /* User data - use this for whatever. */
+   void* data;
++  /* Callback when loop's watcher queue updates. */
++  void (*on_watcher_queue_updated)(uv_loop_t*);
+   /* Loop reference counting. */
+   unsigned int active_handles;
+   void* handle_queue[2];
+diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
+index ca0e345da05bc198c6ca4a44994ffecf64b6810f..237b477120e734e0ab7f2af28d5449ae0686c30a 100644
+--- a/deps/uv/src/unix/core.c
++++ b/deps/uv/src/unix/core.c
+@@ -837,8 +837,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+     return;
+ #endif
+ 
+-  if (QUEUE_EMPTY(&w->watcher_queue))
++  if (QUEUE_EMPTY(&w->watcher_queue)) {
+     QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
++    if (loop->on_watcher_queue_updated)
++      loop->on_watcher_queue_updated(loop);
++  }
+ 
+   if (loop->watchers[w->fd] == NULL) {
+     loop->watchers[w->fd] = w;
+@@ -874,8 +877,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+       w->events = 0;
+     }
+   }
+-  else if (QUEUE_EMPTY(&w->watcher_queue))
++  else if (QUEUE_EMPTY(&w->watcher_queue)) {
+     QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
++    if (loop->on_watcher_queue_updated)
++      loop->on_watcher_queue_updated(loop);
++  }
+ }
+ 
+ 
+@@ -892,6 +898,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
+ void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
+   if (QUEUE_EMPTY(&w->pending_queue))
+     QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
++  if (loop->on_watcher_queue_updated)
++    loop->on_watcher_queue_updated(loop);
+ }
+ 
+ 

+ 42 - 0
patches/common/node/feat_initialize_asar_support.patch

@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Thu, 13 Sep 2018 08:56:07 -0700
+Subject: feat: initialize asar support
+
+
+diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
+index d8dcd6539208181b8f9156008c9a9bb26c0a71a3..ced530a4ce161dfbe130b752161d5c8866b5d3f5 100644
+--- a/lib/internal/bootstrap/loaders.js
++++ b/lib/internal/bootstrap/loaders.js
+@@ -191,6 +191,8 @@ function nativeModuleRequire(id) {
+   return mod.compile();
+ }
+ 
++NativeModule.require = nativeModuleRequire
++
+ NativeModule.exists = function(id) {
+   return NativeModule.map.has(id);
+ };
+diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
+index ab7e169d7ac938f6bd256b4b7736a6cf75a9d4db..b8ea75d28506e3716b233472c724cec2698a7071 100644
+--- a/lib/internal/bootstrap/pre_execution.js
++++ b/lib/internal/bootstrap/pre_execution.js
+@@ -46,6 +46,7 @@ function prepareMainThreadExecution() {
+   initializeFrozenIntrinsics();
+   initializeESMLoader();
+   loadPreloadModules();
++  setupAsarSupport();
+ }
+ 
+ function patchProcessObject() {
+@@ -365,6 +366,10 @@ function loadPreloadModules() {
+   }
+ }
+ 
++function setupAsarSupport() {
++  process._linkedBinding('atom_common_asar').initAsarSupport(require);
++}
++
+ module.exports = {
+   patchProcessObject,
+   setupCoverageHooks,

+ 36 - 0
patches/common/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch

@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Apthorp <[email protected]>
+Date: Wed, 19 Sep 2018 12:20:44 -0700
+Subject: fix: add default values for 'enable_lto' and 'build_v8_with_gn' in
+ common.gypi
+
+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 23ac7205baa36b816018699d6a362326e771e0aa..4877ff08d957b19f1990c6fabf7f4af5515d4a58 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -71,6 +71,22 @@
+ 
+     ##### end V8 defaults #####
+ 
++    # When building native modules using 'npm install' with the system npm,
++    # node-gyp uses the `process.config` of the system npm to fill config.gypi.
++    # If the system npm is not as recent as Electron's node headers, which is
++    # likely, these variables will be missing from that config.gypi, and as a
++    # result, node-gyp will fail when building the native module with an error
++    # like:
++    #
++    #  gyp: name 'enable_lto' is not defined while evaluating condition
++    #  'enable_lto=="true"' in binding.gyp while trying to load binding.gyp
++    #
++    # We set default values here to avoid that error message, even though these
++    # aren't technically accurate, because most native modules don't depend on
++    # these values being accurate.
++    'build_v8_with_gn': 'false',
++    'enable_lto%': 'false',
++
+     'conditions': [
+       ['target_arch=="arm64"', {
+         # Disabled pending https://github.com/nodejs/node/issues/23913.

+ 66 - 0
patches/common/node/fix_build_and_expose_inspector_agent.patch

@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Mon, 30 Jul 2018 15:18:11 -0700
+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 57228ed953302f3ff75df4c245dc32d9511d6616..d0ab6a0e2bceeb3752a09b6961d801d2856aa6ec 100644
+--- a/src/inspector_agent.cc
++++ b/src/inspector_agent.cc
+@@ -205,7 +205,7 @@ const int CONTEXT_GROUP_ID = 1;
+ 
+ std::string GetWorkerLabel(node::Environment* env) {
+   std::ostringstream result;
+-  result << "Worker[" << env->thread_id() << "]";
++  result << "Electron Worker[" << env->thread_id() << "]";
+   return result.str();
+ }
+ 
+@@ -434,7 +434,7 @@ class NodeInspectorClient : public V8InspectorClient {
+     client_ = V8Inspector::create(env->isolate(), this);
+     // TODO(bnoordhuis) Make name configurable from src/node.cc.
+     std::string name =
+-        is_main_ ? GetHumanReadableProcessName() : GetWorkerLabel(env);
++        is_main_ ? "Electron Main Context" : GetWorkerLabel(env);
+     ContextInfo info(name);
+     info.is_default = true;
+     contextCreated(env->context(), info);
+diff --git a/src/inspector_agent.h b/src/inspector_agent.h
+index aa89fbba6bc0992f6e361e3ce7e61aa6933de881..1cc6e59f237b94a1c9d68879238f915f9fecf281 100644
+--- a/src/inspector_agent.h
++++ b/src/inspector_agent.h
+@@ -6,8 +6,10 @@
+ #error("This header can only be used when inspector is enabled")
+ #endif
+ 
++#include "node.h"
+ #include "node_options-inl.h"
+ #include "node_persistent.h"
++#include "node_platform.h"
+ #include "v8.h"
+ 
+ #include <cstddef>
+@@ -41,7 +43,7 @@ class InspectorSessionDelegate {
+                                      = 0;
+ };
+ 
+-class Agent {
++class NODE_EXTERN Agent {
+  public:
+   explicit Agent(node::Environment* env);
+   ~Agent();
+diff --git a/src/inspector_io.cc b/src/inspector_io.cc
+index 20785fc67787dfac502e3af03a0b3a0308dc9b58..5f042f0824d6b5e4e11c8fd488ad42ef769821ef 100644
+--- a/src/inspector_io.cc
++++ b/src/inspector_io.cc
+@@ -14,6 +14,8 @@
+ #include "util.h"
+ #include "zlib.h"
+ 
++#include "libplatform/libplatform.h"
++
+ #include <deque>
+ #include <cstring>
+ #include <vector>

+ 54 - 0
patches/common/node/fix_do_not_define_debugoptions_s_constructors_in_header.patch

@@ -0,0 +1,54 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Fri, 29 Mar 2019 17:17:30 +0900
+Subject: fix: do not define DebugOptions's constructors in header
+
+The e3ca89ef49 changed NODE_EXTERN to always expose symbols for
+DebugOptions, and since the constructors of DebugOptions are defined in
+header, the compiler would end up generating no constructor
+implementations for DebugOptions.
+
+Which means we would encounter crash when constructors of DebugOptions
+is called.
+
+By putting the definitions of constructors into the implementation file,
+we can avoid this problem.
+
+diff --git a/src/node_options.cc b/src/node_options.cc
+index 053be80e50577adfa67f497aa29a6fb276dd7a7a..ed5192b04e3de17944c51df25b1be93eda84cc1b 100644
+--- a/src/node_options.cc
++++ b/src/node_options.cc
+@@ -26,6 +26,12 @@ Mutex cli_options_mutex;
+ std::shared_ptr<PerProcessOptions> cli_options{new PerProcessOptions()};
+ }  // namespace per_process
+ 
++DebugOptions::DebugOptions() = default;
++DebugOptions::DebugOptions(const DebugOptions&) = default;
++DebugOptions::DebugOptions(DebugOptions&&) = default;
++DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
++DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
++
+ void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
+ #if !NODE_USE_V8_PLATFORM
+   if (inspector_enabled) {
+diff --git a/src/node_options.h b/src/node_options.h
+index 5c70bbad76f81584f3f0b0506cf883f6395e235f..158bf8b959b36df91f47c5b04b84e9aa85e449b1 100644
+--- a/src/node_options.h
++++ b/src/node_options.h
+@@ -56,11 +56,11 @@ class Options {
+ // per-Isolate, rather than per-Environment.
+ class NODE_EXTERN DebugOptions : public Options {
+  public:
+-  DebugOptions() = default;
+-  DebugOptions(const DebugOptions&) = default;
+-  DebugOptions& operator=(const DebugOptions&) = default;
+-  DebugOptions(DebugOptions&&) = default;
+-  DebugOptions& operator=(DebugOptions&&) = default;
++  DebugOptions();
++  DebugOptions(const DebugOptions&);
++  DebugOptions& operator=(const DebugOptions&);
++  DebugOptions(DebugOptions&&);
++  DebugOptions& operator=(DebugOptions&&);
+ 
+   // --inspect
+   bool inspector_enabled = false;

+ 21 - 0
patches/common/node/fix_don_t_create_console_window_when_creating_process.patch

@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Mon, 30 Jul 2018 10:23:05 -0700
+Subject: fix: don't create console window when creating process
+
+This commit prevents console windows from being spawned when creating processes to better align with what Windows users expect and should be removed when upgrading to a version that includes https://github.com/nodejs/node/pull/21316
+
+diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c
+index f9c53de0af007961b0d269651d368fd83717976a..fa1a76a2e6626e15bdd0681626fc82c9ca6907fe 100644
+--- a/deps/uv/src/win/process.c
++++ b/deps/uv/src/win/process.c
+@@ -1099,6 +1099,9 @@ int uv_spawn(uv_loop_t* loop,
+     process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP;
+   }
+ 
++  /* Don't create console window. */
++  process_flags |= CREATE_NO_WINDOW;
++
+   if (!CreateProcessW(application_path,
+                      arguments,
+                      NULL,

+ 56 - 0
patches/common/node/fix_export_debugoptions.patch

@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Thu, 11 Apr 2019 11:50:49 -0700
+Subject: fix: export DebugOptions
+
+
+diff --git a/src/node_options.cc b/src/node_options.cc
+index bd20b6385d0c05591dc567614fe2c7d774855528..053be80e50577adfa67f497aa29a6fb276dd7a7a 100644
+--- a/src/node_options.cc
++++ b/src/node_options.cc
+@@ -148,11 +148,6 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
+ 
+ namespace options_parser {
+ 
+-class DebugOptionsParser : public OptionsParser<DebugOptions> {
+- public:
+-  DebugOptionsParser();
+-};
+-
+ class EnvironmentOptionsParser : public OptionsParser<EnvironmentOptions> {
+  public:
+   EnvironmentOptionsParser();
+diff --git a/src/node_options.h b/src/node_options.h
+index e07ee7fb35306511c4d1842d97f6d20fb4334b81..5c70bbad76f81584f3f0b0506cf883f6395e235f 100644
+--- a/src/node_options.h
++++ b/src/node_options.h
+@@ -54,7 +54,7 @@ class Options {
+ // to keep them separate since they are a group of options applying to a very
+ // specific part of Node. It might also make more sense for them to be
+ // per-Isolate, rather than per-Environment.
+-class DebugOptions : public Options {
++class NODE_EXTERN DebugOptions : public Options {
+  public:
+   DebugOptions() = default;
+   DebugOptions(const DebugOptions&) = default;
+@@ -210,7 +210,7 @@ class PerProcessOptions : public Options {
+ 
+ namespace options_parser {
+ 
+-HostPort SplitHostPort(const std::string& arg,
++HostPort NODE_EXTERN SplitHostPort(const std::string& arg,
+     std::vector<std::string>* errors);
+ void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
+ 
+@@ -403,6 +403,11 @@ class OptionsParser {
+   friend void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
+ };
+ 
++class NODE_EXTERN DebugOptionsParser : public OptionsParser<DebugOptions> {
++ public:
++  DebugOptionsParser();
++};
++
+ using StringVector = std::vector<std::string>;
+ template <class OptionsType, class = Options>
+ void Parse(

+ 31 - 0
patches/common/node/fix_export_libuv_symbols_73.patch

@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Apthorp <[email protected]>
+Date: Thu, 11 Oct 2018 16:24:57 -0700
+Subject: fix: export libuv symbols (#73)
+
+Closes electron/electron#15075
+
+diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
+index b62fac6738ae74788faa6e5dcc705b81d8325ece..7370980c52ea03ca02eae3488930432f1857c6fb 100644
+--- a/deps/uv/BUILD.gn
++++ b/deps/uv/BUILD.gn
+@@ -29,6 +29,9 @@ static_library("uv") {
+ 
+   defines = []
+ 
++  # This only has an effect on Windows, where it will cause libuv's symbols to be exported in node.lib
++  defines += [ "BUILDING_UV_SHARED=1" ]
++
+   cflags_c = [
+     "-Wno-bitwise-op-parentheses",
+     "-Wno-implicit-function-declaration",
+@@ -180,9 +183,4 @@ static_library("uv") {
+       "src/unix/kqueue.c",
+     ]
+   }
+-  if (is_component_build && is_win) {
+-    defines += [
+-      "BUILDING_UV_SHARED=1",
+-    ]
+-  }
+ }

+ 49 - 0
patches/common/node/fix_export_node_abort_and_assert.patch

@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Wed, 27 Mar 2019 14:17:15 -0700
+Subject: fix: Export node::Abort and Assert
+
+
+diff --git a/src/node_errors.cc b/src/node_errors.cc
+index 3c04152974339ed2e0d960ebe808cd787e5f34c1..4c7160605958be3f89817c280b30e98c90393cc3 100644
+--- a/src/node_errors.cc
++++ b/src/node_errors.cc
+@@ -230,13 +230,13 @@ void AppendExceptionLine(Environment* env,
+             .FromMaybe(false));
+ }
+ 
+-[[noreturn]] void Abort() {
++[[noreturn]] void NODE_EXTERN Abort() {
+   DumpBacktrace(stderr);
+   fflush(stderr);
+   ABORT_NO_BACKTRACE();
+ }
+ 
+-[[noreturn]] void Assert(const AssertionInfo& info) {
++[[noreturn]] void NODE_EXTERN Assert(const AssertionInfo& info) {
+   char name[1024];
+   GetHumanReadableProcessName(&name);
+ 
+diff --git a/src/util.h b/src/util.h
+index a9de8f8636c11be6d9d198250a7c1dbf0480a453..de3eb36b7e768d2f7c47f45dcac441986a400086 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -24,6 +24,7 @@
+ 
+ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
+ 
++#include "node.h"
+ #include "node_persistent.h"
+ #include "v8.h"
+ 
+@@ -93,8 +94,8 @@ struct AssertionInfo {
+   const char* message;
+   const char* function;
+ };
+-[[noreturn]] void Assert(const AssertionInfo& info);
+-[[noreturn]] void Abort();
++[[noreturn]] void NODE_EXTERN Assert(const AssertionInfo& info);
++[[noreturn]] void NODE_EXTERN Abort();
+ void DumpBacktrace(FILE* fp);
+ 
+ // Windows 8+ does not like abort() in Release mode

+ 20 - 0
patches/common/node/fix_expose_internalcallbackscope.patch

@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Sat, 6 Jan 2018 18:28:10 +0530
+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 012848491ea721b3f685f8dce11fff449634d3a1..1ffe78d33b19a098e9200271a8e809205d8f540b 100644
+--- a/src/node_internals.h
++++ b/src/node_internals.h
+@@ -198,7 +198,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
+     v8::Local<v8::Value> argv[],
+     async_context asyncContext);
+ 
+-class InternalCallbackScope {
++class NODE_EXTERN InternalCallbackScope {
+  public:
+   // Tell the constructor whether its `object` parameter may be empty or not.
+   enum ResourceExpectation { kRequireResource, kAllowEmptyResource };

+ 20 - 0
patches/common/node/fix_expose_traceeventhelper.patch

@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Mon, 30 Jul 2018 13:08:34 -0700
+Subject: fix: expose TraceEventHelper
+
+Node required tracing controller to be initialized, otherwise a crash would occur. Changed in concert with https://github.com/electron/electron/commit/0e5b6f93000e4718c9e35332ddbd0f6b76cdd585\#diff-0cdfa12fff513e022fac830c6af9c19a
+
+diff --git a/src/tracing/trace_event.h b/src/tracing/trace_event.h
+index 590cb592fc054f90ffc85052985087db6c3c3463..4a398106d77e5e0f7c16448fa952c637833cfede 100644
+--- a/src/tracing/trace_event.h
++++ b/src/tracing/trace_event.h
+@@ -310,7 +310,7 @@ const int kZeroNumArgs = 0;
+ const decltype(nullptr) kGlobalScope = nullptr;
+ const uint64_t kNoId = 0;
+ 
+-class TraceEventHelper {
++class NODE_EXTERN TraceEventHelper {
+  public:
+   static TracingController* GetTracingController();
+   static Agent* GetAgent();

+ 42 - 0
patches/common/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch

@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Fri, 26 Oct 2018 15:35:13 +1100
+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 8aa3d1b174bcdd21602c3b695dfa97705b50daad..416851cc87b928417e08210881ef1f5d89b01730 100644
+--- a/src/api/environment.cc
++++ b/src/api/environment.cc
+@@ -267,6 +267,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
+   return per_process::v8_platform.Platform();
+ }
+ 
++node::tracing::Agent* CreateAgent() {
++  return new node::tracing::Agent();
++}
++
+ MultiIsolatePlatform* CreatePlatform(
+     int thread_pool_size,
+     node::tracing::TracingController* tracing_controller) {
+diff --git a/src/node.h b/src/node.h
+index 070abc5be387244484d8cdbb193dc5d7709674fd..d063ccac66fa04c3c7f14f83bd1f80c68426eb0a 100644
+--- a/src/node.h
++++ b/src/node.h
+@@ -108,6 +108,7 @@ namespace node {
+ 
+ namespace tracing {
+ 
++class Agent;
+ class TracingController;
+ 
+ }
+@@ -332,6 +333,8 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
+ // it returns nullptr.
+ NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform();
+ 
++NODE_EXTERN node::tracing::Agent* CreateAgent();
++
+ NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
+     int thread_pool_size,
+     node::tracing::TracingController* tracing_controller);

+ 95 - 0
patches/common/node/fix_key_gen_apis_are_not_available_in_boringssl.patch

@@ -0,0 +1,95 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Fri, 29 Mar 2019 16:50:56 +0900
+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 951dfc447c25762b6f43ed1b86bc4c75ec423dc7..f52971f574c3b952fb19c189b0bbd758b7ee832e 100644
+--- a/src/node_crypto.cc
++++ b/src/node_crypto.cc
+@@ -305,24 +305,14 @@ void Decorate(Environment* env, Local<Object> obj,
+     V(BIO)                                                                    \
+     V(PKCS7)                                                                  \
+     V(X509V3)                                                                 \
+-    V(PKCS12)                                                                 \
+     V(RAND)                                                                   \
+-    V(DSO)                                                                    \
+     V(ENGINE)                                                                 \
+     V(OCSP)                                                                   \
+     V(UI)                                                                     \
+     V(COMP)                                                                   \
+     V(ECDSA)                                                                  \
+     V(ECDH)                                                                   \
+-    V(OSSL_STORE)                                                             \
+-    V(FIPS)                                                                   \
+-    V(CMS)                                                                    \
+-    V(TS)                                                                     \
+     V(HMAC)                                                                   \
+-    V(CT)                                                                     \
+-    V(ASYNC)                                                                  \
+-    V(KDF)                                                                    \
+-    V(SM2)                                                                    \
+     V(USER)                                                                   \
+ 
+ #define V(name) case ERR_LIB_##name: lib = #name "_"; break;
+@@ -2463,8 +2453,11 @@ void SSLWrap<Base>::GetEphemeralKeyInfo(
+             .FromJust();
+         break;
+       case EVP_PKEY_EC:
++      // FIXME(zcbenz): This is not available in BoringSSL.
++#if 0
+       case EVP_PKEY_X25519:
+       case EVP_PKEY_X448:
++#endif
+         {
+           const char* curve_name;
+           if (kid == EVP_PKEY_EC) {
+@@ -3711,12 +3704,15 @@ Local<Value> KeyObject::GetAsymmetricKeyType() const {
+     return env()->crypto_ec_string();
+   case EVP_PKEY_ED25519:
+     return env()->crypto_ed25519_string();
++  // FIXME(zcbenz): This is not available in BoringSSL.
++#if 0
+   case EVP_PKEY_ED448:
+     return env()->crypto_ed448_string();
+   case EVP_PKEY_X25519:
+     return env()->crypto_x25519_string();
+   case EVP_PKEY_X448:
+     return env()->crypto_x448_string();
++#endif
+   default:
+     return Undefined(env()->isolate());
+   }
+@@ -6092,6 +6088,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+     if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
+       return nullptr;
+ 
++    // FIXME(zcbenz): This is not available in BoringSSL.
++#if 0
+     if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
+       return nullptr;
+ 
+@@ -6111,6 +6109,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
+ 
+     EVPKeyCtxPointer key_ctx(EVP_PKEY_CTX_new(params.get(), nullptr));
+     return key_ctx;
++#endif
++    return nullptr;
+   }
+ 
+  private:
+@@ -6767,9 +6767,12 @@ void Initialize(Local<Object> target,
+   env->SetMethod(target, "generateKeyPairEC", GenerateKeyPairEC);
+   env->SetMethod(target, "generateKeyPairNid", GenerateKeyPairNid);
+   NODE_DEFINE_CONSTANT(target, EVP_PKEY_ED25519);
++  // FIXME(zcbenz): This is not available in BoringSSL.
++#if 0
+   NODE_DEFINE_CONSTANT(target, EVP_PKEY_ED448);
+   NODE_DEFINE_CONSTANT(target, EVP_PKEY_X25519);
+   NODE_DEFINE_CONSTANT(target, EVP_PKEY_X448);
++#endif
+   NODE_DEFINE_CONSTANT(target, OPENSSL_EC_NAMED_CURVE);
+   NODE_DEFINE_CONSTANT(target, OPENSSL_EC_EXPLICIT_CURVE);
+   NODE_DEFINE_CONSTANT(target, kKeyEncodingPKCS1);

+ 23 - 0
patches/common/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch

@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Fri, 29 Mar 2019 16:21:42 +0900
+Subject: fix: make it possible to change noBrowserGlobals at runtime
+
+This is a temporary hack in responding to Node's change:
+https://github.com/nodejs/node/pull/26228
+
+We need to figure out a better solution.
+
+diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
+index abd88afce05a0679aa6bbef0cfba0e392e5812ac..cf84468ced9e5936a1de21f885702d4cae168fdb 100644
+--- a/lib/internal/bootstrap/node.js
++++ b/lib/internal/bootstrap/node.js
+@@ -162,7 +162,7 @@ const {
+   queueMicrotask
+ } = require('internal/process/task_queues');
+ 
+-if (!config.noBrowserGlobals) {
++if (!process._noBrowserGlobals) {
+   // Override global console from the one provided by the VM
+   // to the one implemented by Node.js
+   // https://console.spec.whatwg.org/#console-namespace

+ 48 - 0
patches/common/node/fix_use_bssl_bn_bn2bin_padded_for_ossl_s_bn_bn2binpad.patch

@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Wed, 19 Dec 2018 08:54:45 +0530
+Subject: fix: use bssl BN_bn2bin_padded for ossl's BN_bn2binpad
+
+Also note that BN_bn2bin_padded returns 1 on success instead of size
+
+diff --git a/src/node_crypto.cc b/src/node_crypto.cc
+index a5cead4ae5fa735a5a8a59bfcdf492459bd8ea73..c56e488c30784739cf436a0029bdead15aed7541 100644
+--- a/src/node_crypto.cc
++++ b/src/node_crypto.cc
+@@ -5343,9 +5343,9 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
+   const int size = BN_num_bytes(pub_key);
+   CHECK_GE(size, 0);
+   AllocatedBuffer data = env->AllocateManaged(size);
+-  CHECK_EQ(size,
+-           BN_bn2binpad(
+-               pub_key, reinterpret_cast<unsigned char*>(data.data()), size));
++  CHECK_EQ(
++      1,
++      BN_bn2bin_padded(reinterpret_cast<unsigned char*>(data.data()), size, pub_key));
+   args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
+ }
+ 
+@@ -5365,8 +5365,8 @@ void DiffieHellman::GetField(const FunctionCallbackInfo<Value>& args,
+   CHECK_GE(size, 0);
+   AllocatedBuffer data = env->AllocateManaged(size);
+   CHECK_EQ(
+-      size,
+-      BN_bn2binpad(num, reinterpret_cast<unsigned char*>(data.data()), size));
++      1,
++      BN_bn2bin_padded(reinterpret_cast<unsigned char*>(data.data()), size, num));
+   args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
+ }
+ 
+@@ -5689,9 +5689,9 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
+ 
+   const int size = BN_num_bytes(b);
+   AllocatedBuffer out = env->AllocateManaged(size);
+-  CHECK_EQ(size, BN_bn2binpad(b,
+-                              reinterpret_cast<unsigned char*>(out.data()),
+-                              size));
++  CHECK_EQ(1, BN_bn2bin_padded(reinterpret_cast<unsigned char*>(out.data()),
++                                  size,
++                                  b));
+ 
+   Local<Object> buf = out.ToBuffer().ToLocalChecked();
+   args.GetReturnValue().Set(buf);

+ 21 - 0
patches/common/node/fix_wrong_uses_node_allocator_condition.patch

@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Wed, 10 Apr 2019 13:03:28 +0900
+Subject: fix: wrong uses_node_allocator condition
+
+Waiting for reply from upstream:
+https://github.com/nodejs/node/commit/84e02b178ad14fae0df2a514e8a39bfa50ffdc2d#r33116006
+
+diff --git a/src/node_buffer.cc b/src/node_buffer.cc
+index 6bc9cfeed3188f8387255b6e5bf2da2797f1bb06..8d172aff7d362236c57fa493806501fdbb1b61d3 100644
+--- a/src/node_buffer.cc
++++ b/src/node_buffer.cc
+@@ -420,7 +420,7 @@ MaybeLocal<Object> New(Environment* env,
+   }
+ 
+   if (uses_malloc) {
+-    if (env->isolate_data()->uses_node_allocator()) {
++    if (!env->isolate_data()->uses_node_allocator()) {
+       // We don't know for sure that the allocator is malloc()-based, so we need
+       // to fall back to the FreeCallback variant.
+       auto free_callback = [](char* data, void* hint) { free(data); };

+ 64 - 0
patches/common/node/fixme_add_back_nativemoduleloader_compileandcall.patch

@@ -0,0 +1,64 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Wed, 27 Mar 2019 00:28:29 -0700
+Subject: fixme: Add back NativeModuleLoader CompileAndCall
+
+Node removed the NativeModuleLoader CompileAndCall function and exposed
+the LookupAndCompile function, with the intention of giving the ability
+to the caller to handle errors. The node PR made the changes
+https://github.com/nodejs/node/pull/25667.
+I'm adding this back for now, but this can easily be moved to electron
+as a helper or can probably be upstreamed somehow.
+
+diff --git a/src/node_native_module.cc b/src/node_native_module.cc
+index 47d3d94f1277904e3128dc03aee0f41c26ab91b0..fec7dcd940fa757fdb1c23252a3588ef46f98992 100644
+--- a/src/node_native_module.cc
++++ b/src/node_native_module.cc
+@@ -272,6 +272,24 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
+   return scope.Escape(fun);
+ }
+ 
++MaybeLocal<Value> NativeModuleLoader::CompileAndCall(
++    Local<Context> context,
++    const char* id,
++    std::vector<Local<String>>* parameters,
++    std::vector<Local<Value>>* arguments,
++    Environment* optional_env) {
++  Isolate* isolate = context->GetIsolate();
++  MaybeLocal<Function> compiled =
++      per_process::native_module_loader.LookupAndCompile(
++          context, id, parameters, nullptr);
++  if (compiled.IsEmpty()) {
++    return MaybeLocal<Value>();
++  }
++  Local<Function> fn = compiled.ToLocalChecked().As<Function>();
++  return fn->Call(
++      context, v8::Null(isolate), arguments->size(), arguments->data());
++}
++
+ void NativeModuleLoader::Initialize(Local<Object> target,
+                                     Local<Value> unused,
+                                     Local<Context> context,
+diff --git a/src/node_native_module.h b/src/node_native_module.h
+index cbf625fc4df290cf774ce394f525019e331cd79c..b873145602cc43e616d6b6bceafe15b1431b0efc 100644
+--- a/src/node_native_module.h
++++ b/src/node_native_module.h
+@@ -53,6 +53,18 @@ class NODE_EXTERN NativeModuleLoader {
+       std::vector<v8::Local<v8::String>>* parameters,
+       Environment* optional_env);
+ 
++  // Run a script with JS source bundled inside the binary as if it's wrapped
++  // in a function called with a null receiver and arguments specified in C++.
++  // The returned value is empty if an exception is encountered.
++  // JS code run with this method can assume that their top-level
++  // declarations won't affect the global scope.
++  v8::MaybeLocal<v8::Value> CompileAndCall(
++      v8::Local<v8::Context> context,
++      const char* id,
++      std::vector<v8::Local<v8::String>>* parameters,
++      std::vector<v8::Local<v8::Value>>* arguments,
++      Environment* optional_env);
++
+  private:
+   static void GetCacheUsage(const v8::FunctionCallbackInfo<v8::Value>& args);
+   // Passing ids of builtin module source code into JS land as

+ 24 - 0
patches/common/node/fixme_comment_trace_event_macro.patch

@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Tue, 26 Mar 2019 11:28:05 -0700
+Subject: fixme: Comment trace event macro
+
+
+diff --git a/src/node_internals.h b/src/node_internals.h
+index aff9a9a99397575fd6aba4105ed70aef5c646963..ed3c2175e4e3d174d75b5b21eaec5c8c97fbb18b 100644
+--- a/src/node_internals.h
++++ b/src/node_internals.h
+@@ -347,10 +347,11 @@ class TraceEventScope {
+   TraceEventScope(const char* category,
+                   const char* name,
+                   void* id) : category_(category), name_(name), id_(id) {
+-    TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_, name_, id_);
++    // TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_, name_, id_);
++    (void) category_; (void)name_; (void)id_;
+   }
+   ~TraceEventScope() {
+-    TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_);
++    // TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_);
+   }
+ 
+  private:

+ 25 - 0
patches/common/node/fixme_remove_async_id_assertion_check.patch

@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Thu, 13 Sep 2018 09:08:10 -0700
+Subject: FIXME: remove async_id assertion check
+
+
+diff --git a/src/api/callback.cc b/src/api/callback.cc
+index 52a8da35b671d196331b858ba46be04aecf1e0be..43ccfafd9f2c85e23a9ea6277e88e4864e287905 100644
+--- a/src/api/callback.cc
++++ b/src/api/callback.cc
+@@ -103,12 +103,14 @@ void InternalCallbackScope::Close() {
+     env_->isolate()->RunMicrotasks();
+   }
+ 
++#if 0  // FIXME(codebytere): figure out why this check fails/causes crash
+   // Make sure the stack unwound properly. If there are nested MakeCallback's
+   // then it should return early and not reach this code.
+   if (env_->async_hooks()->fields()[AsyncHooks::kTotals]) {
+     CHECK_EQ(env_->execution_async_id(), 0);
+     CHECK_EQ(env_->trigger_async_id(), 0);
+   }
++#endif
+ 
+   if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn()) {
+     return;

+ 24 - 0
patches/common/node/fixme_use_redefined_version_of_internalmodulestat.patch

@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Thu, 13 Sep 2018 09:10:02 -0700
+Subject: FIXME: use redefined version of internalModuleStat
+
+Instantiate redefined version of the internalModuleStat function
+(see lib/common/asar.js in the electron/electron repo). For some reason
+this has to be done after the upgrade to the Node.js v8.7.0. `const
+internalModuleStat` in the very beginning of the file holds a reference
+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 3eeadbd4fc7a2ba4f91549d9bb4360dd672fd7aa..add4c6be1f14e13d8685d0cd6e5332bf7f6535a9 100644
+--- a/lib/internal/modules/cjs/loader.js
++++ b/lib/internal/modules/cjs/loader.js
+@@ -88,6 +88,8 @@ const isWindows = process.platform === 'win32';
+ let requireDepth = 0;
+ let statCache = new Map();
+ function stat(filename) {
++  // FIXME(codebytere): determine why this needs to be done and remove
++  const internalModuleStat = process.binding('fs').internalModuleStat;
+   filename = path.toNamespacedPath(filename);
+   if (statCache === null) statCache = new Map();
+   let result = statCache.get(filename);

+ 213 - 0
patches/common/node/fsevents_fix_file_event_reporting.patch

@@ -0,0 +1,213 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ben Noordhuis <[email protected]>
+Date: Mon, 27 May 2019 14:31:53 +0200
+Subject: fsevents: fix file event reporting
+
+Commit 2d2af38 ("fsevents: really watch files with fsevents on macos
+10.7+") from last November introduced a regression where events that
+were previously reported as UV_RENAME were now reported as UV_CHANGE.
+This commit rectifies that.
+
+Fixes: https://github.com/nodejs/node/issues/27869
+
+diff --git a/deps/uv/src/unix/fsevents.c b/deps/uv/src/unix/fsevents.c
+index c430562b37298a0065f6d39ecbb7e2857c863ca1..fd94df5e68a44beda683df99e6af7cc49350cb55 100644
+--- a/deps/uv/src/unix/fsevents.c
++++ b/deps/uv/src/unix/fsevents.c
+@@ -48,19 +48,9 @@ void uv__fsevents_loop_delete(uv_loop_t* loop) {
+ #include <CoreFoundation/CFRunLoop.h>
+ #include <CoreServices/CoreServices.h>
+ 
+-/* These are macros to avoid "initializer element is not constant" errors
++/* Macro to avoid "initializer element is not constant" errors
+  * with old versions of gcc.
+  */
+-#define kFSEventsModified (kFSEventStreamEventFlagItemFinderInfoMod |         \
+-                           kFSEventStreamEventFlagItemModified |              \
+-                           kFSEventStreamEventFlagItemInodeMetaMod |          \
+-                           kFSEventStreamEventFlagItemChangeOwner |           \
+-                           kFSEventStreamEventFlagItemXattrMod)
+-
+-#define kFSEventsRenamed  (kFSEventStreamEventFlagItemCreated |               \
+-                           kFSEventStreamEventFlagItemRemoved |               \
+-                           kFSEventStreamEventFlagItemRenamed)
+-
+ #define kFSEventsSystem   (kFSEventStreamEventFlagUserDropped |               \
+                            kFSEventStreamEventFlagKernelDropped |             \
+                            kFSEventStreamEventFlagEventIdsWrapped |           \
+@@ -288,8 +278,6 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
+             path--;
+             len++;
+           }
+-          /* Created and Removed seem to be always set, but don't make sense */
+-          flags &= ~kFSEventsRenamed;
+         } else {
+           /* Skip forward slash */
+           path++;
+@@ -310,12 +298,12 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
+ 
+       memset(event, 0, sizeof(*event));
+       memcpy(event->path, path, len + 1);
+-      event->events = UV_RENAME;
++      event->events = UV_CHANGE;
+ 
+-      if (0 == (flags & kFSEventsRenamed)) {
+-        if (0 != (flags & kFSEventsModified) ||
+-            0 == (flags & kFSEventStreamEventFlagItemIsDir))
+-          event->events = UV_CHANGE;
++      if ((flags & kFSEventStreamEventFlagItemIsDir) ||
++          (flags & kFSEventStreamEventFlagItemRemoved) ||
++          (flags & kFSEventStreamEventFlagItemRenamed)) {
++        event->events = UV_RENAME;
+       }
+ 
+       QUEUE_INSERT_TAIL(&head, &event->member);
+diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c
+index ea34bd63a70625c3e2c60d5a1bbb087c5f0bbb2e..38d722a27ef1a78717726272d54578c734280242 100644
+--- a/deps/uv/test/test-fs-event.c
++++ b/deps/uv/test/test-fs-event.c
+@@ -62,6 +62,15 @@ static char fs_event_filename[1024];
+ static int timer_cb_touch_called;
+ static int timer_cb_exact_called;
+ 
++static void expect_filename(const char* path, const char* expected) {
++#if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
++  ASSERT(0 == strcmp(path, expected));
++#else
++  if (path != NULL)
++    ASSERT(0 == strcmp(path, expected));
++#endif
++}
++
+ static void fs_event_fail(uv_fs_event_t* handle,
+                           const char* filename,
+                           int events,
+@@ -130,11 +139,7 @@ static void fs_event_cb_dir(uv_fs_event_t* handle, const char* filename,
+   ASSERT(handle == &fs_event);
+   ASSERT(status == 0);
+   ASSERT(events == UV_CHANGE);
+-  #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
+-  ASSERT(strcmp(filename, "file1") == 0);
+-  #else
+-  ASSERT(filename == NULL || strcmp(filename, "file1") == 0);
+-  #endif
++  expect_filename(filename, "file1");
+   ASSERT(0 == uv_fs_event_stop(handle));
+   uv_close((uv_handle_t*)handle, close_cb);
+ }
+@@ -312,11 +317,7 @@ static void fs_event_cb_file(uv_fs_event_t* handle, const char* filename,
+   ASSERT(handle == &fs_event);
+   ASSERT(status == 0);
+   ASSERT(events == UV_CHANGE);
+-  #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
+-  ASSERT(strcmp(filename, "file2") == 0);
+-  #else
+-  ASSERT(filename == NULL || strcmp(filename, "file2") == 0);
+-  #endif
++  expect_filename(filename, "file2");
+   ASSERT(0 == uv_fs_event_stop(handle));
+   uv_close((uv_handle_t*)handle, close_cb);
+ }
+@@ -339,11 +340,7 @@ static void fs_event_cb_file_current_dir(uv_fs_event_t* handle,
+   ASSERT(handle == &fs_event);
+   ASSERT(status == 0);
+   ASSERT(events == UV_CHANGE);
+-  #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__)
+-  ASSERT(strcmp(filename, "watch_file") == 0);
+-  #else
+-  ASSERT(filename == NULL || strcmp(filename, "watch_file") == 0);
+-  #endif
++  expect_filename(filename, "watch_file");
+ 
+   /* Regression test for SunOS: touch should generate just one event. */
+   {
+@@ -619,6 +616,69 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
+   return 0;
+ }
+ 
++static void file_remove_cb(uv_fs_event_t* handle,
++                           const char* path,
++                           int events,
++                           int status) {
++  fs_event_cb_called++;
++
++  expect_filename(path, "file1");
++  /* TODO(bnoordhuis) Harmonize the behavior across platforms. Right now
++   * this test merely ensures the status quo doesn't regress.
++   */
++#if defined(_AIX) || defined(__linux__)
++  ASSERT(UV_CHANGE == events);
++#else
++  ASSERT(UV_RENAME == events);
++#endif
++  ASSERT(0 == status);
++
++  uv_close((uv_handle_t*) handle, NULL);
++}
++
++static void file_remove_next(uv_timer_t* handle) {
++  uv_close((uv_handle_t*) handle, NULL);
++  remove("watch_dir/file1");
++}
++
++static void file_remove_start(uv_timer_t* handle) {
++  uv_fs_event_t* watcher;
++  uv_loop_t* loop;
++
++  loop = handle->loop;
++  watcher = handle->data;
++
++  ASSERT(0 == uv_fs_event_init(loop, watcher));
++  ASSERT(0 == uv_fs_event_start(watcher, file_remove_cb, "watch_dir/file1", 0));
++  ASSERT(0 == uv_timer_start(handle, file_remove_next, 50, 0));
++}
++
++TEST_IMPL(fs_event_watch_file_remove) {
++  uv_fs_event_t watcher;
++  uv_timer_t timer;
++  uv_loop_t* loop;
++
++#if defined(__MVS__)
++  RETURN_SKIP("test does not work on this OS");
++#endif
++
++  remove("watch_dir/file1");
++  remove("watch_dir/");
++  create_dir("watch_dir");
++  create_file("watch_dir/file1");
++
++  loop = uv_default_loop();
++  timer.data = &watcher;
++
++  ASSERT(0 == uv_timer_init(loop, &timer));
++  ASSERT(0 == uv_timer_start(&timer, file_remove_start, 500, 0));
++  ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
++  ASSERT(1 == fs_event_cb_called);
++
++  MAKE_VALGRIND_HAPPY();
++  return 0;
++}
++
+ TEST_IMPL(fs_event_watch_file_twice) {
+ #if defined(NO_FS_EVENTS)
+   RETURN_SKIP(NO_FS_EVENTS);
+diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h
+index f498c7dc81f1e54ce788a1c6a5c7653cbd5bbd31..81c5d9ae142e93d4d0a0a9de510a1166e6564d36 100644
+--- a/deps/uv/test/test-list.h
++++ b/deps/uv/test/test-list.h
+@@ -327,6 +327,7 @@ TEST_DECLARE   (fs_event_watch_dir_short_path)
+ #endif
+ TEST_DECLARE   (fs_event_watch_file)
+ TEST_DECLARE   (fs_event_watch_file_exact_path)
++TEST_DECLARE   (fs_event_watch_file_remove)
+ TEST_DECLARE   (fs_event_watch_file_twice)
+ TEST_DECLARE   (fs_event_watch_file_current_dir)
+ #ifdef _WIN32
+@@ -903,6 +904,7 @@ TASK_LIST_START
+ #endif
+   TEST_ENTRY  (fs_event_watch_file)
+   TEST_ENTRY  (fs_event_watch_file_exact_path)
++  TEST_ENTRY  (fs_event_watch_file_remove)
+   TEST_ENTRY  (fs_event_watch_file_twice)
+   TEST_ENTRY  (fs_event_watch_file_current_dir)
+ #ifdef _WIN32

+ 91 - 0
patches/common/node/http2_fix_tracking_received_data_for_maxsessionmemory.patch

@@ -0,0 +1,91 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Anna Henningsen <[email protected]>
+Date: Sun, 26 May 2019 17:48:47 +0200
+Subject: http2: fix tracking received data for maxSessionMemory
+
+Track received data correctly. Specifically, for the buffer that
+is used for receiving data, we previously would try to increment
+the current memory usage by its length, and later decrement it
+by that, but in the meantime the buffer had been turned over to V8
+and its length reset to zero. This gave the impression that more and
+more memory was consumed by the HTTP/2 session when it was in fact not.
+
+Fixes: https://github.com/nodejs/node/issues/27416
+Refs: https://github.com/nodejs/node/pull/26207
+
+PR-URL: https://github.com/nodejs/node/pull/27914
+Reviewed-By: Colin Ihrig <[email protected]>
+Reviewed-By: Rich Trott <[email protected]>
+
+diff --git a/src/node_http2.cc b/src/node_http2.cc
+index b2666f1c8b6a4eb3c524a6af3ca90aa561565fc8..8f0254dfb15bc7003ab2b5c53024209a02d59db4 100644
+--- a/src/node_http2.cc
++++ b/src/node_http2.cc
+@@ -1789,11 +1789,13 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf_) {
+   // Shrink to the actual amount of used data.
+   buf.Resize(nread);
+ 
+-  IncrementCurrentSessionMemory(buf.size());
++  IncrementCurrentSessionMemory(nread);
+   OnScopeLeave on_scope_leave([&]() {
+     // Once finished handling this write, reset the stream buffer.
+     // The memory has either been free()d or was handed over to V8.
+-    DecrementCurrentSessionMemory(buf.size());
++    // We use `nread` instead of `buf.size()` here, because the buffer is
++    // cleared as part of the `.ToArrayBuffer()` call below.
++    DecrementCurrentSessionMemory(nread);
+     stream_buf_ab_ = Local<ArrayBuffer>();
+     stream_buf_ = uv_buf_init(nullptr, 0);
+   });
+diff --git a/test/parallel/test-http2-max-session-memory-leak.js b/test/parallel/test-http2-max-session-memory-leak.js
+new file mode 100644
+index 0000000000000000000000000000000000000000..b066ca80bc5eabc089625cf643f790637ad6aeea
+--- /dev/null
++++ b/test/parallel/test-http2-max-session-memory-leak.js
+@@ -0,0 +1,46 @@
++'use strict';
++const common = require('../common');
++if (!common.hasCrypto)
++  common.skip('missing crypto');
++const http2 = require('http2');
++
++// Regression test for https://github.com/nodejs/node/issues/27416.
++// Check that received data is accounted for correctly in the maxSessionMemory
++// mechanism.
++
++const bodyLength = 8192;
++const maxSessionMemory = 1;  // 1 MB
++const requestCount = 1000;
++
++const server = http2.createServer({ maxSessionMemory });
++server.on('stream', (stream) => {
++  stream.respond();
++  stream.end();
++});
++
++server.listen(common.mustCall(() => {
++  const client = http2.connect(`http://localhost:${server.address().port}`, {
++    maxSessionMemory
++  });
++
++  function request() {
++    return new Promise((resolve, reject) => {
++      const stream = client.request({
++        ':method': 'POST',
++        'content-length': bodyLength
++      });
++      stream.on('error', reject);
++      stream.on('response', resolve);
++      stream.end('a'.repeat(bodyLength));
++    });
++  }
++
++  (async () => {
++    for (let i = 0; i < requestCount; i++) {
++      await request();
++    }
++
++    client.close();
++    server.close();
++  })().then(common.mustCall());
++}));

+ 22 - 0
patches/common/node/inherit_electron_crashpad_pipe_name_in_child_process.patch

@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Tue, 4 Jun 2019 17:42:11 +0900
+Subject: Inherit ELECTRON_CRASHPAD_PIPE_NAME in child process
+
+This is required for crashReporter to work correctly in node process.
+
+diff --git a/lib/child_process.js b/lib/child_process.js
+index 42fb15551faeeea6ab5ec6c3d59c1f1aea68903d..b45af0459623c89800566e5e29c322bca0d17048 100644
+--- a/lib/child_process.js
++++ b/lib/child_process.js
+@@ -114,6 +114,10 @@ exports.fork = function fork(modulePath /* , args, options */) {
+ 
+   options.env.ELECTRON_RUN_AS_NODE = 1;
+ 
++  if (process.platform === 'win32') {
++    options.env.ELECTRON_CRASHPAD_PIPE_NAME = process.env.ELECTRON_CRASHPAD_PIPE_NAME;
++  }
++
+   if (!options.execPath && process.type && process.platform == 'darwin') {
+     options.execPath = process.helperExecPath;
+   }

+ 26 - 0
patches/common/node/make_module_globalpaths_a_reference.patch

@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Sun, 14 Apr 2013 15:54:46 +0800
+Subject: Make Module.globalPaths a reference.
+
+We need to hack the search paths of the require function so we can
+load libraries from embedded applications without modifications of
+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 54bad5a444502aa604d39a90b6084efa89db5822..eb632e13583c6446f0a62ae66ac5e8f57c3f0c52 100644
+--- a/lib/internal/modules/cjs/loader.js
++++ b/lib/internal/modules/cjs/loader.js
+@@ -935,8 +935,8 @@ Module._initPaths = function() {
+ 
+   modulePaths = paths;
+ 
+-  // Clone as a shallow copy, for introspection.
+-  Module.globalPaths = modulePaths.slice(0);
++  // clone as a shallow copy, for introspection.
++  Module.globalPaths = modulePaths;
+ };
+ 
+ Module._preloadModules = function(requests) {

+ 40 - 0
patches/common/node/pass_all_globals_through_require.patch

@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Cheng Zhao <[email protected]>
+Date: Sun, 27 Mar 2016 14:42:26 +0900
+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 eb632e13583c6446f0a62ae66ac5e8f57c3f0c52..3eeadbd4fc7a2ba4f91549d9bb4360dd672fd7aa 100644
+--- a/lib/internal/modules/cjs/loader.js
++++ b/lib/internal/modules/cjs/loader.js
+@@ -76,6 +76,13 @@ const {
+   CHAR_9,
+ } = require('internal/constants');
+ 
++// Store the "global" variable from global scope into a local scope, so we can
++// still reference it from this file even after we deleted the "global" variable
++// from the global scope.
++const localGlobal = global;
++// Do the same for "Buffer".
++const localBuffer = Buffer;
++
+ const isWindows = process.platform === 'win32';
+ 
+ let requireDepth = 0;
+@@ -822,10 +829,12 @@ Module.prototype._compile = function(content, filename) {
+   const module = this;
+   if (inspectorWrapper) {
+     result = inspectorWrapper(compiledWrapper, thisValue, exports,
+-                              require, module, filename, dirname);
++                              require, module, filename, dirname, process,
++                              localGlobal, localBuffer);
+   } else {
+     result = compiledWrapper.call(thisValue, exports, require, module,
+-                                  filename, dirname);
++                                  filename, dirname, process, localGlobal,
++                                  localBuffer);
+   }
+   if (requireDepth === 0) statCache = null;
+   return result;

+ 61 - 0
patches/common/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch

@@ -0,0 +1,61 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Mon, 22 Apr 2019 13:23:37 -0700
+Subject: refactor: allow embedder overriding of internal FS calls
+
+
+diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
+index cf84468ced9e5936a1de21f885702d4cae168fdb..0d44d7db7cbd342a26f09f8fe9f32f10c77a1c48 100644
+--- a/lib/internal/bootstrap/node.js
++++ b/lib/internal/bootstrap/node.js
+@@ -64,6 +64,10 @@ if (ownsProcessState) {
+   );
+ }
+ 
++// NOTE: Electron deletes this references before user code runs so that
++// internalBinding is not leaked to user code
++process.internalBinding = internalBinding;
++
+ // process.config is serialized config.gypi
+ process.config = JSON.parse(internalBinding('native_module').config);
+ 
+diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
+index add4c6be1f14e13d8685d0cd6e5332bf7f6535a9..f5ee6436a63ad6bd93688a3db74986c9d20343ba 100644
+--- a/lib/internal/modules/cjs/loader.js
++++ b/lib/internal/modules/cjs/loader.js
+@@ -29,10 +29,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 internalFsBinding = internalBinding('fs');
+ const { safeGetenv } = internalBinding('credentials');
+ const {
+   makeRequireFunction,
+@@ -88,13 +85,11 @@ const isWindows = process.platform === 'win32';
+ let requireDepth = 0;
+ let statCache = new Map();
+ function stat(filename) {
+-  // FIXME(codebytere): determine why this needs to be done and remove
+-  const internalModuleStat = process.binding('fs').internalModuleStat;
+   filename = path.toNamespacedPath(filename);
+   if (statCache === null) statCache = new Map();
+   let result = statCache.get(filename);
+   if (result !== undefined) return result;
+-  result = internalModuleStat(filename);
++  result = internalFsBinding.internalModuleStat(filename);
+   statCache.set(filename, result);
+   return result;
+ }
+@@ -207,7 +202,7 @@ function readPackage(requestPath) {
+     return entry;
+ 
+   const jsonPath = path.resolve(requestPath, 'package.json');
+-  const json = internalModuleReadJSON(path.toNamespacedPath(jsonPath));
++  const json = internalFsBinding.internalModuleReadJSON(path.toNamespacedPath(jsonPath));
+ 
+   if (json === undefined) {
+     return false;

+ 29 - 0
patches/common/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch

@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Mon, 30 Jul 2018 10:30:35 -0700
+Subject: refactor: alter child_process.fork to use execute script with
+ Electron
+
+When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary.
+
+diff --git a/lib/child_process.js b/lib/child_process.js
+index 7d0b692141a86d24ed9eed842ee7ea9d90c97f1c..42fb15551faeeea6ab5ec6c3d59c1f1aea68903d 100644
+--- a/lib/child_process.js
++++ b/lib/child_process.js
+@@ -108,6 +108,16 @@ exports.fork = function fork(modulePath /* , args, options */) {
+     throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
+   }
+ 
++  if (!options.env) {
++    options.env = Object.create(process.env);
++  }
++
++  options.env.ELECTRON_RUN_AS_NODE = 1;
++
++  if (!options.execPath && process.type && process.platform == 'darwin') {
++    options.execPath = process.helperExecPath;
++  }
++
+   options.execPath = options.execPath || process.execPath;
+   options.shell = false;
+ 

+ 20 - 0
patches/common/node/src_disable_node_use_v8_platform_in_node_options.patch

@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Thu, 4 Apr 2019 16:45:35 -0700
+Subject: src: Disable NODE_USE_V8_PLATFORM in node_options
+
+Electron does not set NODE_USE_V8_PLATFORM. If inspector is enabled when NODE_USE_V8_PLATFORM is false, then there's an error. We want to ignore that, use our own v8 platform but still use the node inspector
+
+diff --git a/src/node_options.cc b/src/node_options.cc
+index ed5192b04e3de17944c51df25b1be93eda84cc1b..d88885a77aa59a17548a9d1908c97dd491a18734 100644
+--- a/src/node_options.cc
++++ b/src/node_options.cc
+@@ -33,7 +33,7 @@ DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
+ DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
+ 
+ void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
+-#if !NODE_USE_V8_PLATFORM
++#if 0
+   if (inspector_enabled) {
+     errors->push_back("Inspector is not available when Node is compiled "
+                       "--without-v8-platform");

+ 19 - 0
patches/common/node/src_only_run_preloadmodules_if_the_preload_array_is_not_empty.patch

@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Sun, 2 Jun 2019 00:27:17 -0700
+Subject: src: only run preloadModules if the preload array is not empty
+
+
+diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
+index b8ea75d28506e3716b233472c724cec2698a7071..582579cccf0c048659173670d1e578344fd70024 100644
+--- a/lib/internal/bootstrap/pre_execution.js
++++ b/lib/internal/bootstrap/pre_execution.js
+@@ -358,7 +358,7 @@ function initializeFrozenIntrinsics() {
+ function loadPreloadModules() {
+   // For user code, we preload modules if `-r` is passed
+   const preloadModules = getOptionValue('--require');
+-  if (preloadModules) {
++  if (preloadModules && preloadModules.length > 0) {
+     const {
+       _preloadModules
+     } = require('internal/modules/cjs/loader');

+ 21 - 0
patches/common/node/src_read_break_node_first_line_from_the_inspect_options.patch

@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Samuel Attard <[email protected]>
+Date: Sun, 2 Jun 2019 12:43:59 -0700
+Subject: src: read break_node_first_line from the inspect options
+
+There are cases where the debug_options() on the env are
+different to the options that were passed into inspector::Agent.
+
+diff --git a/src/node.cc b/src/node.cc
+index 6f07d07a7bc3dc21b777d29aad0def17cd889bbc..2f2b52e13362bec6fcee5716d9a2bc9b3480b939 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -286,7 +286,7 @@ MaybeLocal<Value> RunBootstrapping(Environment* env) {
+   };
+ 
+ #if HAVE_INSPECTOR
+-  if (env->options()->debug_options().break_node_first_line) {
++  if (env->inspector_agent()->options().break_node_first_line) {
+     env->inspector_agent()->PauseOnNextJavascriptStatement(
+         "Break at bootstrap");
+   }

+ 20 - 0
patches/common/node/src_use_check_false_in_switch_default_case.patch

@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nitish Sakhawalkar <[email protected]>
+Date: Thu, 7 Mar 2019 17:02:13 -0800
+Subject: src: use CHECK(false) in switch default case
+
+Porting https://github.com/nodejs/node/pull/26502
+
+diff --git a/src/node_crypto.cc b/src/node_crypto.cc
+index c56e488c30784739cf436a0029bdead15aed7541..951dfc447c25762b6f43ed1b86bc4c75ec423dc7 100644
+--- a/src/node_crypto.cc
++++ b/src/node_crypto.cc
+@@ -3447,7 +3447,7 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs(
+           is_public = false;
+           break;
+         default:
+-          CHECK(!"Invalid key encoding type");
++          CHECK(false);
+       }
+ 
+       if (is_public) {