GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: add detailed embedder process initialization API · nodejs/node@9dc33f1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • embedding.md
  • src
    • node.cc
    • node.h
    • node_credentials.cc
    • node_internals.h
    • node_main.cc
    • node_main_instance.cc
  • test/embedding
    • embedtest.cc
  • tools/snapshot
    • node_mksnapshot.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/embedding.md‎

Copy file name to clipboardExpand all lines: doc/api/embedding.md
+13-7Lines changed: 13 additions & 7 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ the `node` and `v8` C++ namespaces, respectively.
3737
int main(int argc, char** argv) {
3838
argv = uv_setup_args(argc, argv);
3939
std::vector<std::string> args(argv, argv + argc);
40-
std::vector<std::string> exec_args;
41-
std::vector<std::string> errors;
4240
// Parse Node.js CLI options, and print any errors that have occurred while
4341
// trying to parse them.
44-
int exit_code = node::InitializeNodeWithArgs(&args, &exec_args, &errors);
45-
for (const std::string& error : errors)
42+
std::unique_ptr<node::InitializationResult> result =
43+
node::InitializeOncePerProcess(args, {
44+
node::ProcessInitializationFlags::kNoInitializeV8,
45+
node::ProcessInitializationFlags::kNoInitializeNodeV8Platform
46+
});
47+
48+
for (const std::string& error : result->errors())
4649
fprintf(stderr, "%s: %s\n", args[0].c_str(), error.c_str());
47-
if (exit_code != 0) {
48-
return exit_code;
50+
if (result->early_return() != 0) {
51+
return result->exit_code();
4952
}
5053

5154
// Create a v8::Platform instance. `MultiIsolatePlatform::Create()` is a way
@@ -58,10 +61,13 @@ int main(int argc, char** argv) {
5861
V8::Initialize();
5962

6063
// See below for the contents of this function.
61-
int ret = RunNodeInstance(platform.get(), args, exec_args);
64+
int ret = RunNodeInstance(
65+
platform.get(), result->args(), result->exec_args());
6266

6367
V8::Dispose();
6468
V8::DisposePlatform();
69+
70+
node::TearDownOncePerProcess();
6571
return ret;
6672
}
6773
```

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.