Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: move process.reallyExit impl into node_process_methods.cc #25860

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ using v8::Exception;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Int32;
using v8::Isolate;
using v8::Just;
using v8::Local;
Expand Down Expand Up @@ -163,7 +162,7 @@ struct V8Platform v8_platform;
static const unsigned kMaxSignal = 32;
#endif

static void WaitForInspectorDisconnect(Environment* env) {
void WaitForInspectorDisconnect(Environment* env) {
#if HAVE_INSPECTOR
if (env->inspector_agent()->IsActive()) {
// Restore signal dispositions, the app is done and is no longer
Expand All @@ -183,13 +182,6 @@ static void WaitForInspectorDisconnect(Environment* env) {
#endif
}

void Exit(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
WaitForInspectorDisconnect(env);
int code = args[0]->Int32Value(env->context()).FromMaybe(0);
env->Exit(code);
}

void SignalExit(int signo) {
uv_tty_reset_mode();
#ifdef __FreeBSD__
Expand Down
2 changes: 1 addition & 1 deletion src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(err);
}

void Exit(const v8::FunctionCallbackInfo<v8::Value>& args);
void WaitForInspectorDisconnect(Environment* env);
void SignalExit(int signo);
#ifdef __POSIX__
void RegisterSignalHandler(int signal,
Expand Down
9 changes: 8 additions & 1 deletion src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args) {
#endif
}

static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
WaitForInspectorDisconnect(env);
int code = args[0]->Int32Value(env->context()).FromMaybe(0);
env->Exit(code);
}

static void InitializeProcessMethods(Local<Object> target,
Local<Value> unused,
Local<Context> context,
Expand Down Expand Up @@ -416,7 +423,7 @@ static void InitializeProcessMethods(Local<Object> target,

env->SetMethodNoSideEffect(target, "cwd", Cwd);
env->SetMethod(target, "dlopen", binding::DLOpen);
env->SetMethod(target, "reallyExit", Exit);
env->SetMethod(target, "reallyExit", ReallyExit);
env->SetMethodNoSideEffect(target, "uptime", Uptime);
}

Expand Down