mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: move DebugPortGetter/Setter to node_process.cc
PR-URL: https://github.com/nodejs/node/pull/22758 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
1 parent
efd4796fa9
commit
eaaee92d9b
3 files changed
+34
-27
No files matched your search
-27
@@ -160,7 +160,6 @@ using v8::Object;
|
||||
using v8::ObjectTemplate;
|
||||
using v8::Promise;
|
||||
using v8::PropertyAttribute;
|
||||
using v8::PropertyCallbackInfo;
|
||||
using v8::ReadOnly;
|
||||
using v8::Script;
|
||||
using v8::ScriptCompiler;
|
||||
@@ -1672,32 +1671,6 @@ static Local<Object> GetFeatures(Environment* env) {
|
||||
return scope.Escape(obj);
|
||||
}
|
||||
|
||||
|
||||
static void DebugPortGetter(Local<Name> property,
|
||||
const PropertyCallbackInfo<Value>& info) {
|
||||
Environment* env = Environment::GetCurrent(info);
|
||||
Mutex::ScopedLock lock(process_mutex);
|
||||
int port = env->options()->debug_options->port();
|
||||
#if HAVE_INSPECTOR
|
||||
if (port == 0) {
|
||||
if (auto io = env->inspector_agent()->io())
|
||||
port = io->port();
|
||||
}
|
||||
#endif // HAVE_INSPECTOR
|
||||
info.GetReturnValue().Set(port);
|
||||
}
|
||||
|
||||
|
||||
static void DebugPortSetter(Local<Name> property,
|
||||
Local<Value> value,
|
||||
const PropertyCallbackInfo<void>& info) {
|
||||
Environment* env = Environment::GetCurrent(info);
|
||||
Mutex::ScopedLock lock(process_mutex);
|
||||
env->options()->debug_options->host_port.port =
|
||||
value->Int32Value(env->context()).FromMaybe(0);
|
||||
}
|
||||
|
||||
|
||||
static void DebugProcess(const FunctionCallbackInfo<Value>& args);
|
||||
static void DebugEnd(const FunctionCallbackInfo<Value>& args);
|
||||
|
||||
|
||||
Reference in new issue
Block a user