fix: broken --trace-sync-io flag in Node.js (#24529)

This commit is contained in:
Shelley Vohr 2020-07-14 10:47:20 -07:00 committed by GitHub
parent 990a6f8b6c
commit ce87a7e69f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -75,7 +75,6 @@
"parallel/test-signal-handler",
"parallel/test-source-map",
"parallel/test-stdout-close-catch",
"parallel/test-sync-io-option",
"parallel/test-tls-cert-chains-concat",
"parallel/test-tls-cert-chains-in-ca",
"parallel/test-tls-cli-max-version-1.2",

View file

@ -256,6 +256,8 @@ int NodeMain(int argc, char* argv[]) {
node::LoadEnvironment(env);
}
env->set_trace_sync_io(env->options()->trace_sync_io);
{
v8::SealHandleScope seal(isolate);
bool more;
@ -279,6 +281,9 @@ int NodeMain(int argc, char* argv[]) {
}
node_debugger.Stop();
env->set_trace_sync_io(false);
exit_code = node::EmitExit(env);
node::ResetStdio();

View file

@ -325,6 +325,8 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
node_debugger_ = std::make_unique<NodeDebugger>(env);
node_debugger_->Start();
env->set_trace_sync_io(env->options()->trace_sync_io);
// Add Electron extended APIs.
electron_bindings_->BindTo(js_env_->isolate(), env->process_object());
@ -547,6 +549,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
// Destroy node platform after all destructors_ are executed, as they may
// invoke Node/V8 APIs inside them.
node_debugger_->Stop();
node_env_->env()->set_trace_sync_io(false);
js_env_->OnMessageLoopDestroying();
node_env_.reset();