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: nodejs#24017
Refs: nodejs#30467
Refs: nodejs#32858
  • Loading branch information
addaleax committed Jun 19, 2020
1 parent 56967af commit d7bca2d
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 @@ -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',
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 d7bca2d

Please sign in to comment.