diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-10-31 15:31:38 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2020-11-02 16:21:10 +0300 |
commit | dfc288e7fdbe888f4e134772de421684247f0bea (patch) | |
tree | 49ad0d1aa0dea08a2c9884cd299df0eef836d5dc /src/node.cc | |
parent | 09af8c822c8e931b29427aaec72604ab03fa54c1 (diff) |
src: clean up embedder API
Remove deprecated APIs (and deprecate one legacy API).
PR-URL: https://github.com/nodejs/node/pull/35897
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/node.cc b/src/node.cc index efb4876002f..c3f423cb579 100644 --- a/src/node.cc +++ b/src/node.cc @@ -947,51 +947,6 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv, return 0; } -// TODO(addaleax): Deprecate and eventually remove this. -void Init(int* argc, - const char** argv, - int* exec_argc, - const char*** exec_argv) { - std::vector<std::string> argv_(argv, argv + *argc); // NOLINT - std::vector<std::string> exec_argv_; - std::vector<std::string> errors; - - // This (approximately) duplicates some logic that has been moved to - // node::Start(), with the difference that here we explicitly call `exit()`. - int exit_code = InitializeNodeWithArgs(&argv_, &exec_argv_, &errors); - - for (const std::string& error : errors) - fprintf(stderr, "%s: %s\n", argv_.at(0).c_str(), error.c_str()); - if (exit_code != 0) exit(exit_code); - - if (per_process::cli_options->print_version) { - printf("%s\n", NODE_VERSION); - exit(0); - } - - if (per_process::cli_options->print_bash_completion) { - std::string completion = options_parser::GetBashCompletion(); - printf("%s\n", completion.c_str()); - exit(0); - } - - if (per_process::cli_options->print_v8_help) { - V8::SetFlagsFromString("--help", static_cast<size_t>(6)); - exit(0); - } - - *argc = argv_.size(); - *exec_argc = exec_argv_.size(); - // These leak memory, because, in the original code of this function, no - // extra allocations were visible. This should be okay because this function - // is only supposed to be called once per process, though. - *exec_argv = Malloc<const char*>(*exec_argc); - for (int i = 0; i < *exec_argc; ++i) - (*exec_argv)[i] = strdup(exec_argv_[i].c_str()); - for (int i = 0; i < *argc; ++i) - argv[i] = strdup(argv_[i].c_str()); -} - InitializationResult InitializeOncePerProcess(int argc, char** argv) { // Initialized the enabled list for Debug() calls with system // environment variables. |