| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -823,7 +823,7 @@ static ExitCode InitializeNodeWithArgsInternal( | |||
| 823 | 823 | std::vector<std::string>* exec_argv, | |
| 824 | 824 | std::vector<std::string>* errors, | |
| 825 | 825 | ProcessInitializationFlags::Flags flags) { | |
| 826 | - // Make sure InitializeNodeWithArgs() is called only once. | ||
| 826 | + // Make sure InitializeNodeWithArgsInternal() is called only once. | ||
| 827 | 827 | CHECK(!init_called.exchange(true)); | |
| 828 | 828 | ||
| 829 | 829 | // Initialize node_start_time to get relative uptime. | |
@@ -1021,14 +1021,6 @@ static ExitCode InitializeNodeWithArgsInternal( | |||
| 1021 | 1021 | return ExitCode::kNoFailure; | |
| 1022 | 1022 | } | |
| 1023 | 1023 | ||
| 1024 | - int InitializeNodeWithArgs(std::vector<std::string>* argv, | ||
| 1025 | - std::vector<std::string>* exec_argv, | ||
| 1026 | - std::vector<std::string>* errors, | ||
| 1027 | - ProcessInitializationFlags::Flags flags) { | ||
| 1028 | - return static_cast<int>( | ||
| 1029 | - InitializeNodeWithArgsInternal(argv, exec_argv, errors, flags)); | ||
| 1030 | - } | ||
| 1031 | - | ||
| 1032 | 1024 | static std::shared_ptr<InitializationResultImpl> | |
| 1033 | 1025 | InitializeOncePerProcessInternal(const std::vector<std::string>& args, | |
| 1034 | 1026 | ProcessInitializationFlags::Flags flags = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -329,22 +329,6 @@ NODE_EXTERN int Start(int argc, char* argv[]); | |||
| 329 | 329 | NODE_EXTERN int Stop(Environment* env, | |
| 330 | 330 | StopFlags::Flags flags = StopFlags::kNoFlags); | |
| 331 | 331 | ||
| 332 | - // Set up per-process state needed to run Node.js. This will consume arguments | ||
| 333 | - // from argv, fill exec_argv, and possibly add errors resulting from parsing | ||
| 334 | - // the arguments to `errors`. The return value is a suggested exit code for the | ||
| 335 | - // program; If it is 0, then initializing Node.js succeeded. | ||
| 336 | - // This runs a subset of the initialization performed by | ||
| 337 | - // InitializeOncePerProcess(), which supersedes this function. | ||
| 338 | - // The subset is roughly equivalent to the one given by | ||
| 339 | - // `ProcessInitializationFlags::kLegacyInitializeNodeWithArgsBehavior`. | ||
| 340 | - NODE_DEPRECATED("Use InitializeOncePerProcess() instead", | ||
| 341 | - NODE_EXTERN int InitializeNodeWithArgs( | ||
| 342 | - std::vector<std::string>* argv, | ||
| 343 | - std::vector<std::string>* exec_argv, | ||
| 344 | - std::vector<std::string>* errors, | ||
| 345 | - ProcessInitializationFlags::Flags flags = | ||
| 346 | - ProcessInitializationFlags::kNoFlags)); | ||
| 347 | - | ||
| 348 | 332 | // Set up per-process state needed to run Node.js. This will consume arguments | |
| 349 | 333 | // from args, and return information about the initialization success, | |
| 350 | 334 | // including the arguments split into argv/exec_argv, a list of potential | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,13 +81,15 @@ class NodeZeroIsolateTestFixture : public ::testing::Test { | |||
| 81 | 81 | if (!node_initialized) { | |
| 82 | 82 | node_initialized = true; | |
| 83 | 83 | uv_os_unsetenv("NODE_OPTIONS"); | |
| 84 | - std::vector<std::string> argv { "cctest" }; | ||
| 85 | - std::vector<std::string> exec_argv; | ||
| 86 | - std::vector<std::string> errors; | ||
| 87 | - | ||
| 88 | - int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors); | ||
| 89 | - CHECK_EQ(exitcode, 0); | ||
| 90 | - CHECK(errors.empty()); | ||
| 84 | + std::vector<std::string> argv{"cctest"}; | ||
| 85 | + | ||
| 86 | + std::shared_ptr<node::InitializationResult> result = | ||
| 87 | + node::InitializeOncePerProcess( | ||
| 88 | + argv, | ||
| 89 | + node::ProcessInitializationFlags:: | ||
| 90 | + kLegacyInitializeNodeWithArgsBehavior); | ||
| 91 | + CHECK_EQ(result->exit_code(), 0); | ||
| 92 | + CHECK(result->errors().empty()); | ||
| 91 | 93 | } | |
| 92 | 94 | CHECK_EQ(0, uv_loop_init(¤t_loop)); | |
| 93 | 95 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments