Skip to content

Commit 22e1aea

Browse files
zcbenzbnoordhuis
authored andcommitted
src: set node_is_initialized in node::Init
This can make node_is_initialized correctly set to true for applications that use node::Init to embed iojs. PR-URL: #225 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 668420d commit 22e1aea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/node.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -3426,6 +3426,11 @@ void Init(int* argc,
34263426
if (!use_debug_agent) {
34273427
RegisterDebugSignalHandler();
34283428
}
3429+
3430+
// We should set node_is_initialized here instead of in node::Start,
3431+
// otherwise embedders using node::Init to initialize everything will not be
3432+
// able to set it and native modules will not load for them.
3433+
node_is_initialized = true;
34293434
}
34303435

34313436

@@ -3634,7 +3639,6 @@ int Start(int argc, char** argv) {
36343639

36353640
int code;
36363641
V8::Initialize();
3637-
node_is_initialized = true;
36383642

36393643
// Fetch a reference to the main isolate, so we have a reference to it
36403644
// even when we need it to access it from another (debugger) thread.

0 commit comments

Comments
 (0)