|
|
@@ -4047,10 +4047,11 @@ void EmitBeforeExit(Environment* env) { |
|
|
|
HandleScope handle_scope(env->isolate()); |
|
|
|
Context::Scope context_scope(env->context()); |
|
|
|
Local<Object> process_object = env->process_object(); |
|
|
|
Local<String> exit_code = FIXED_ONE_BYTE_STRING(env->isolate(), "exitCode"); |
|
|
|
Local<String> exit_code = env->exit_code_string(); |
|
|
|
Local<Value> args[] = { |
|
|
|
FIXED_ONE_BYTE_STRING(env->isolate(), "beforeExit"), |
|
|
|
process_object->Get(exit_code)->ToInteger(env->context()).ToLocalChecked() |
|
|
|
process_object->Get(env->context(), exit_code).ToLocalChecked() |
|
|
|
->ToInteger(env->context()).ToLocalChecked() |
|
|
|
}; |
|
|
|
MakeCallback(env->isolate(), |
|
|
|
process_object, "emit", arraysize(args), args, |
|
|
@@ -4063,13 +4064,15 @@ int EmitExit(Environment* env) { |
|
|
|
HandleScope handle_scope(env->isolate()); |
|
|
|
Context::Scope context_scope(env->context()); |
|
|
|
Local<Object> process_object = env->process_object(); |
|
|
|
process_object->Set(env->exiting_string(), True(env->isolate())); |
|
|
|
process_object->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "_exiting"), |
|
|
|
True(env->isolate())); |
|
|
|
|
|
|
|
Local<String> exitCode = env->exit_code_string(); |
|
|
|
int code = process_object->Get(exitCode)->Int32Value(); |
|
|
|
Local<String> exit_code = env->exit_code_string(); |
|
|
|
int code = process_object->Get(env->context(), exit_code).ToLocalChecked() |
|
|
|
->Int32Value(env->context()).ToChecked(); |
|
|
|
|
|
|
|
Local<Value> args[] = { |
|
|
|
env->exit_string(), |
|
|
|
FIXED_ONE_BYTE_STRING(env->isolate(), "exit"), |
|
|
|
Integer::New(env->isolate(), code) |
|
|
|
}; |
|
|
|
|
|
|
@@ -4078,7 +4081,8 @@ int EmitExit(Environment* env) { |
|
|
|
{0, 0}).ToLocalChecked(); |
|
|
|
|
|
|
|
// Reload exit code, it may be changed by `emit('exit')` |
|
|
|
return process_object->Get(exitCode)->Int32Value(); |
|
|
|
return process_object->Get(env->context(), exit_code).ToLocalChecked() |
|
|
|
->Int32Value(env->context()).ToChecked(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
0 comments on commit
39b3875