GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: cleanup beforeExit for consistency · nodejs/node@39b3875

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • env.h
    • node.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ struct PackageConfig {
160160
V(env_pairs_string, "envPairs") \
161161
V(errno_string, "errno") \
162162
V(error_string, "error") \
163-
V(exiting_string, "_exiting") \
164163
V(exit_code_string, "exitCode") \
165-
V(exit_string, "exit") \
166164
V(expire_string, "expire") \
167165
V(exponent_string, "exponent") \
168166
V(exports_string, "exports") \
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,10 +4047,11 @@ void EmitBeforeExit(Environment* env) {
40474047
HandleScope handle_scope(env->isolate());
40484048
Context::Scope context_scope(env->context());
40494049
Local<Object> process_object = env->process_object();
4050-
Local<String> exit_code = FIXED_ONE_BYTE_STRING(env->isolate(), "exitCode");
4050+
Local<String> exit_code = env->exit_code_string();
40514051
Local<Value> args[] = {
40524052
FIXED_ONE_BYTE_STRING(env->isolate(), "beforeExit"),
4053-
process_object->Get(exit_code)->ToInteger(env->context()).ToLocalChecked()
4053+
process_object->Get(env->context(), exit_code).ToLocalChecked()
4054+
->ToInteger(env->context()).ToLocalChecked()
40544055
};
40554056
MakeCallback(env->isolate(),
40564057
process_object, "emit", arraysize(args), args,
@@ -4063,13 +4064,15 @@ int EmitExit(Environment* env) {
40634064
HandleScope handle_scope(env->isolate());
40644065
Context::Scope context_scope(env->context());
40654066
Local<Object> process_object = env->process_object();
4066-
process_object->Set(env->exiting_string(), True(env->isolate()));
4067+
process_object->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "_exiting"),
4068+
True(env->isolate()));
40674069

4068-
Local<String> exitCode = env->exit_code_string();
4069-
int code = process_object->Get(exitCode)->Int32Value();
4070+
Local<String> exit_code = env->exit_code_string();
4071+
int code = process_object->Get(env->context(), exit_code).ToLocalChecked()
4072+
->Int32Value(env->context()).ToChecked();
40704073

40714074
Local<Value> args[] = {
4072-
env->exit_string(),
4075+
FIXED_ONE_BYTE_STRING(env->isolate(), "exit"),
40734076
Integer::New(env->isolate(), code)
40744077
};
40754078

@@ -4078,7 +4081,8 @@ int EmitExit(Environment* env) {
40784081
{0, 0}).ToLocalChecked();
40794082

40804083
// Reload exit code, it may be changed by `emit('exit')`
4081-
return process_object->Get(exitCode)->Int32Value();
4084+
return process_object->Get(env->context(), exit_code).ToLocalChecked()
4085+
->Int32Value(env->context()).ToChecked();
40824086
}
40834087

40844088

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.