| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,9 +160,7 @@ struct PackageConfig { | |||
| 160 | 160 | V(env_pairs_string, "envPairs") \ | |
| 161 | 161 | V(errno_string, "errno") \ | |
| 162 | 162 | V(error_string, "error") \ | |
| 163 | - V(exiting_string, "_exiting") \ | ||
| 164 | 163 | V(exit_code_string, "exitCode") \ | |
| 165 | - V(exit_string, "exit") \ | ||
| 166 | 164 | V(expire_string, "expire") \ | |
| 167 | 165 | V(exponent_string, "exponent") \ | |
| 168 | 166 | V(exports_string, "exports") \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4047,10 +4047,11 @@ void EmitBeforeExit(Environment* env) { | |||
| 4047 | 4047 | HandleScope handle_scope(env->isolate()); | |
| 4048 | 4048 | Context::Scope context_scope(env->context()); | |
| 4049 | 4049 | 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(); | ||
| 4051 | 4051 | Local<Value> args[] = { | |
| 4052 | 4052 | 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() | ||
| 4054 | 4055 | }; | |
| 4055 | 4056 | MakeCallback(env->isolate(), | |
| 4056 | 4057 | process_object, "emit", arraysize(args), args, | |
@@ -4063,13 +4064,15 @@ int EmitExit(Environment* env) { | |||
| 4063 | 4064 | HandleScope handle_scope(env->isolate()); | |
| 4064 | 4065 | Context::Scope context_scope(env->context()); | |
| 4065 | 4066 | 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())); | ||
| 4067 | 4069 | ||
| 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(); | ||
| 4070 | 4073 | ||
| 4071 | 4074 | Local<Value> args[] = { | |
| 4072 | - env->exit_string(), | ||
| 4075 | + FIXED_ONE_BYTE_STRING(env->isolate(), "exit"), | ||
| 4073 | 4076 | Integer::New(env->isolate(), code) | |
| 4074 | 4077 | }; | |
| 4075 | 4078 | ||
@@ -4078,7 +4081,8 @@ int EmitExit(Environment* env) { | |||
| 4078 | 4081 | {0, 0}).ToLocalChecked(); | |
| 4079 | 4082 | ||
| 4080 | 4083 | // 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(); | ||
| 4082 | 4086 | } | |
| 4083 | 4087 | ||
| 4084 | 4088 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments