File tree Expand file tree Collapse file tree 3 files changed +34
-27
lines changed Open diff view settings
Expand file tree Collapse file tree 3 files changed +34
-27
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ using v8::Object;
160160using v8::ObjectTemplate;
161161using v8::Promise;
162162using v8::PropertyAttribute;
163- using v8::PropertyCallbackInfo;
164163using v8::ReadOnly;
165164using v8::Script;
166165using v8::ScriptCompiler;
@@ -1733,32 +1732,6 @@ static Local<Object> GetFeatures(Environment* env) {
17331732 return scope.Escape (obj);
17341733}
17351734
1736-
1737- static void DebugPortGetter (Local<Name> property,
1738- const PropertyCallbackInfo<Value>& info) {
1739- Environment* env = Environment::GetCurrent (info);
1740- Mutex::ScopedLock lock (process_mutex);
1741- int port = env->options ()->debug_options ->port ();
1742- #if HAVE_INSPECTOR
1743- if (port == 0 ) {
1744- if (auto io = env->inspector_agent ()->io ())
1745- port = io->port ();
1746- }
1747- #endif // HAVE_INSPECTOR
1748- info.GetReturnValue ().Set (port);
1749- }
1750-
1751-
1752- static void DebugPortSetter (Local<Name> property,
1753- Local<Value> value,
1754- const PropertyCallbackInfo<void >& info) {
1755- Environment* env = Environment::GetCurrent (info);
1756- Mutex::ScopedLock lock (process_mutex);
1757- env->options ()->debug_options ->host_port .port =
1758- value->Int32Value (env->context ()).FromMaybe (0 );
1759- }
1760-
1761-
17621735static void DebugProcess (const FunctionCallbackInfo<Value>& args);
17631736static void DebugEnd (const FunctionCallbackInfo<Value>& args);
17641737
Original file line number Diff line number Diff line change @@ -910,6 +910,11 @@ void EnvSetter(v8::Local<v8::Name> property,
910910void EnvQuery (v8::Local<v8::Name> property,
911911 const v8::PropertyCallbackInfo<v8::Integer>& info);
912912void EnvEnumerator (const v8::PropertyCallbackInfo<v8::Array>& info);
913+ void DebugPortGetter (v8::Local<v8::Name> property,
914+ const v8::PropertyCallbackInfo<v8::Value>& info);
915+ void DebugPortSetter (v8::Local<v8::Name> property,
916+ v8::Local<v8::Value> value,
917+ const v8::PropertyCallbackInfo<void >& info);
913918
914919void GetParentProcessId (v8::Local<v8::Name> property,
915920 const v8::PropertyCallbackInfo<v8::Value>& info);
Original file line number Diff line number Diff line change 77#include " uv.h"
88#include " v8.h"
99
10+ #if HAVE_INSPECTOR
11+ #include " inspector_io.h"
12+ #endif
13+
1014#include < limits.h> // PATH_MAX
1115#include < stdio.h>
1216
@@ -833,4 +837,29 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
833837 args.GetReturnValue ().Set (ary);
834838}
835839
840+ void DebugPortGetter (Local<Name> property,
841+ const PropertyCallbackInfo<Value>& info) {
842+ Environment* env = Environment::GetCurrent (info);
843+ Mutex::ScopedLock lock (process_mutex);
844+ int port = env->options ()->debug_options ->port ();
845+ #if HAVE_INSPECTOR
846+ if (port == 0 ) {
847+ if (auto io = env->inspector_agent ()->io ())
848+ port = io->port ();
849+ }
850+ #endif // HAVE_INSPECTOR
851+ info.GetReturnValue ().Set (port);
852+ }
853+
854+
855+ void DebugPortSetter (Local<Name> property,
856+ Local<Value> value,
857+ const PropertyCallbackInfo<void >& info) {
858+ Environment* env = Environment::GetCurrent (info);
859+ Mutex::ScopedLock lock (process_mutex);
860+ env->options ()->debug_options ->host_port .port =
861+ value->Int32Value (env->context ()).FromMaybe (0 );
862+ }
863+
864+
836865} // namespace node
You can’t perform that action at this time.
0 commit comments