From d7bca2dfb33128bf914cb12aabb39ed1430fc6b6 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 19 Jun 2020 17:10:28 +0200 Subject: [PATCH] src: remove _third_party_main support Since 7dead8440c7ee, there is a more official alternative that is tested and comes with a proper API, and since a6c57cc66d0, the `LoadEnvironment(env)` overload is deprecated, which is the closest thing we can achieve to deprecating `_third_party_main` support. Thus, we can now consider us able to remove `_third_party_main` support. Fixes: https://github.com/nodejs/node/issues/24017 Refs: https://github.com/nodejs/node/pull/30467 Refs: https://github.com/nodejs/node/pull/32858 --- lib/internal/cli_table.js | 3 +-- lib/internal/main/run_third_party_main.js | 13 ------------- node.gyp | 1 - src/node.cc | 7 ------- 4 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 lib/internal/main/run_third_party_main.js diff --git a/lib/internal/cli_table.js b/lib/internal/cli_table.js index 853f02797fce41..2a5f0acd471909 100644 --- a/lib/internal/cli_table.js +++ b/lib/internal/cli_table.js @@ -11,8 +11,7 @@ const { getStringWidth } = require('internal/util/inspect'); // The use of Unicode characters below is the only non-comment use of non-ASCII // Unicode characters in Node.js built-in modules. If they are ever removed or // rewritten with \u escapes, then a test will need to be (re-)added to Node.js -// core to verify that Unicode characters work in built-ins. Otherwise, -// consumers using Unicode in _third_party_main.js will run into problems. +// core to verify that Unicode characters work in built-ins. // Refs: https://github.com/nodejs/node/issues/10673 const tableChars = { /* eslint-disable node-core/non-ascii-character */ diff --git a/lib/internal/main/run_third_party_main.js b/lib/internal/main/run_third_party_main.js deleted file mode 100644 index 5fb1d39bc6d072..00000000000000 --- a/lib/internal/main/run_third_party_main.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const { - prepareMainThreadExecution -} = require('internal/bootstrap/pre_execution'); - -prepareMainThreadExecution(); -markBootstrapComplete(); - -// Legacy _third_party_main.js support -process.nextTick(() => { - require('_third_party_main'); -}); diff --git a/node.gyp b/node.gyp index ddf59f4a0273cf..ff5201844d39c7 100644 --- a/node.gyp +++ b/node.gyp @@ -161,7 +161,6 @@ '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/run_main.js', 'lib/internal/modules/package_json_reader.js', diff --git a/src/node.cc b/src/node.cc index b7435d67f839ea..b83e888ab3cb1d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -461,13 +461,6 @@ MaybeLocal StartExecution(Environment* env, StartExecutionCallback cb) { return scope.EscapeMaybe(cb(info)); } - // To allow people to extend Node in different ways, this hook allows - // one to drop a file lib/_third_party_main.js into the build - // directory which will be executed instead of Node's normal loading. - if (NativeModuleEnv::Exists("_third_party_main")) { - return StartExecution(env, "internal/main/run_third_party_main"); - } - if (env->worker_context() != nullptr) { return StartExecution(env, "internal/main/worker_thread"); }