Skip to content

Commit

Permalink
src: remove _third_party_main support
Browse files Browse the repository at this point in the history
Since 7dead84, there is a more official alternative that is
tested and comes with a proper API, and since a6c57cc, 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: #24017
Refs: #30467
Refs: #32858

PR-URL: #33971
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
addaleax authored and jasnell committed Jun 24, 2020
1 parent 78ca61e commit 53fb2b6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
3 changes: 1 addition & 2 deletions lib/internal/cli_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
13 changes: 0 additions & 13 deletions lib/internal/main/run_third_party_main.js

This file was deleted.

1 change: 0 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,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',
Expand Down
7 changes: 0 additions & 7 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,6 @@ MaybeLocal<Value> 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");
}
Expand Down

0 comments on commit 53fb2b6

Please sign in to comment.