Skip to content

src: remove deprecated process exit APIs in node.h #58469

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

Merged
merged 1 commit into from
May 29, 2025
Merged
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
12 changes: 0 additions & 12 deletions src/api/hooks.cc
Original file line number Diff line number Diff line change
@@ -26,10 +26,6 @@ void AtExit(Environment* env, void (*cb)(void* arg), void* arg) {
env->AtExit(cb, arg);
}

void EmitBeforeExit(Environment* env) {
USE(EmitProcessBeforeExit(env));
}

Maybe<bool> EmitProcessBeforeExit(Environment* env) {
TRACE_EVENT0(TRACING_CATEGORY_NODE1(environment), "BeforeExit");
if (!env->destroy_async_id_list()->empty())
@@ -50,14 +46,6 @@ Maybe<bool> EmitProcessBeforeExit(Environment* env) {
: Just(true);
}

static ExitCode EmitExitInternal(Environment* env) {
return EmitProcessExitInternal(env).FromMaybe(ExitCode::kGenericUserError);
}

int EmitExit(Environment* env) {
return static_cast<int>(EmitExitInternal(env));
}

Maybe<ExitCode> EmitProcessExitInternal(Environment* env) {
// process.emit('exit')
Isolate* isolate = env->isolate();
4 changes: 0 additions & 4 deletions src/node.h
Original file line number Diff line number Diff line change
@@ -867,13 +867,9 @@ NODE_EXTERN void SetTracingController(v8::TracingController* controller);
// Run `process.emit('beforeExit')` as it would usually happen when Node.js is
// run in standalone mode.
NODE_EXTERN v8::Maybe<bool> EmitProcessBeforeExit(Environment* env);
NODE_DEPRECATED("Use Maybe version (EmitProcessBeforeExit) instead",
NODE_EXTERN void EmitBeforeExit(Environment* env));
// Run `process.emit('exit')` as it would usually happen when Node.js is run
// in standalone mode. The return value corresponds to the exit code.
NODE_EXTERN v8::Maybe<int> EmitProcessExit(Environment* env);
NODE_DEPRECATED("Use Maybe version (EmitProcessExit) instead",
NODE_EXTERN int EmitExit(Environment* env));

// Runs hooks added through `AtExit()`. This is part of `FreeEnvironment()`,
// so calling it manually is typically not necessary.
Loading
Oops, something went wrong.