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;
@@ -1672,32 +1671,6 @@ static Local<Object> GetFeatures(Environment* env) {
16721671 return scope.Escape (obj);
16731672}
16741673
1675-
1676- static void DebugPortGetter (Local<Name> property,
1677- const PropertyCallbackInfo<Value>& info) {
1678- Environment* env = Environment::GetCurrent (info);
1679- Mutex::ScopedLock lock (process_mutex);
1680- int port = env->options ()->debug_options ->port ();
1681- #if HAVE_INSPECTOR
1682- if (port == 0 ) {
1683- if (auto io = env->inspector_agent ()->io ())
1684- port = io->port ();
1685- }
1686- #endif // HAVE_INSPECTOR
1687- info.GetReturnValue ().Set (port);
1688- }
1689-
1690-
1691- static void DebugPortSetter (Local<Name> property,
1692- Local<Value> value,
1693- const PropertyCallbackInfo<void >& info) {
1694- Environment* env = Environment::GetCurrent (info);
1695- Mutex::ScopedLock lock (process_mutex);
1696- env->options ()->debug_options ->host_port .port =
1697- value->Int32Value (env->context ()).FromMaybe (0 );
1698- }
1699-
1700-
17011674static void DebugProcess (const FunctionCallbackInfo<Value>& args);
17021675static void DebugEnd (const FunctionCallbackInfo<Value>& args);
17031676
Original file line number Diff line number Diff line change @@ -905,6 +905,11 @@ void EnvSetter(v8::Local<v8::Name> property,
905905void EnvQuery (v8::Local<v8::Name> property,
906906 const v8::PropertyCallbackInfo<v8::Integer>& info);
907907void EnvEnumerator (const v8::PropertyCallbackInfo<v8::Array>& info);
908+ void DebugPortGetter (v8::Local<v8::Name> property,
909+ const v8::PropertyCallbackInfo<v8::Value>& info);
910+ void DebugPortSetter (v8::Local<v8::Name> property,
911+ v8::Local<v8::Value> value,
912+ const v8::PropertyCallbackInfo<void >& info);
908913
909914void GetParentProcessId (v8::Local<v8::Name> property,
910915 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
@@ -842,4 +846,29 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
842846 args.GetReturnValue ().Set (ary);
843847}
844848
849+ void DebugPortGetter (Local<Name> property,
850+ const PropertyCallbackInfo<Value>& info) {
851+ Environment* env = Environment::GetCurrent (info);
852+ Mutex::ScopedLock lock (process_mutex);
853+ int port = env->options ()->debug_options ->port ();
854+ #if HAVE_INSPECTOR
855+ if (port == 0 ) {
856+ if (auto io = env->inspector_agent ()->io ())
857+ port = io->port ();
858+ }
859+ #endif // HAVE_INSPECTOR
860+ info.GetReturnValue ().Set (port);
861+ }
862+
863+
864+ void DebugPortSetter (Local<Name> property,
865+ Local<Value> value,
866+ const PropertyCallbackInfo<void >& info) {
867+ Environment* env = Environment::GetCurrent (info);
868+ Mutex::ScopedLock lock (process_mutex);
869+ env->options ()->debug_options ->host_port .port =
870+ value->Int32Value (env->context ()).FromMaybe (0 );
871+ }
872+
873+
845874} // namespace node
You can’t perform that action at this time.
0 commit comments