Skip to content

Commit 5539564

Browse files
author
Johannes Schneider
authored
Merge pull request #47 from hpicgs/expose_internals
changed the way internals are exposed.
2 parents ecee92a + b607c9f commit 5539564

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

src/node.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5072,6 +5072,23 @@ Local<Context> context;
50725072
Context::Scope* context_scope;
50735073
bool request_stop = false;
50745074
CmdArgs* cmd_args = nullptr;
5075+
bool _event_loop_running = false;
5076+
v8::Isolate* _isolate = nullptr;
5077+
Environment* _environment = nullptr;
5078+
5079+
bool EventLoopIsRunning() {
5080+
return _event_loop_running;
5081+
}
5082+
5083+
namespace internal {
5084+
v8::Isolate* isolate() {
5085+
return _isolate;
5086+
}
5087+
5088+
Environment* environment() {
5089+
return _environment;
5090+
}
5091+
}
50755092

50765093
namespace deinitialize {
50775094

src/node_lib.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@
99

1010
namespace node { namespace lib {
1111

12-
namespace { // private variables
13-
bool _event_loop_running = false;
14-
v8::Isolate* _isolate = nullptr;
15-
Environment* _environment = nullptr;
16-
}
12+
namespace internal { // internals, made for experienced users
1713

18-
const bool EventLoopIsRunning() { return _event_loop_running; }
14+
v8::Isolate* isolate();
1915

20-
const v8::Isolate* isolate() { return _isolate; }
16+
Environment* environment();
17+
}
2118

22-
const Environment* environment() { return _environment; }
19+
bool EventLoopIsRunning();
2320

2421
/*********************************************************
2522
* Function types

0 commit comments

Comments
 (0)