fix: no more need to hijack process.stdout on Win32 (#25765)

This commit is contained in:
Cheng Zhao 2020-10-06 02:10:38 +09:00 committed by GitHub
parent 9717dff4fa
commit 57dc170e81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 9 additions and 63 deletions

View file

@ -11,7 +11,6 @@ feat_add_new_built_with_electron_variable_to_config_gypi.patch
feat_add_flags_for_low-level_hooks_and_exceptions.patch
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
pass_all_globals_through_require.patch
call_process_log_from_fallback_stream_on_windows.patch
fixme_remove_async_id_assertion_check.patch
fixme_comment_trace_event_macro.patch
fix_key_gen_apis_are_not_available_in_boringssl.patch

View file

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki <kevinsawicki@gmail.com>
Date: Wed, 12 Oct 2016 09:43:26 -0700
Subject: Call process.log from fallback stream on Windows
(cherry picked from commit d31e629b4f2daf3500a485caab2b2990a41e3ad4)
diff --git a/lib/internal/bootstrap/switches/is_main_thread.js b/lib/internal/bootstrap/switches/is_main_thread.js
index 08623898edafacfa8cee47ab35bd75887f9d3e2a..828589d4047ac49d16e9080ad1f364484941aa6e 100644
--- a/lib/internal/bootstrap/switches/is_main_thread.js
+++ b/lib/internal/bootstrap/switches/is_main_thread.js
@@ -85,6 +85,11 @@ function createWritableStdioStream(fd) {
const { Writable } = require('stream');
stream = new Writable({
write(buf, enc, cb) {
+ if (process.platform === 'win32' &&
+ process.env.ELECTRON_RUN_AS_NODE &&
+ !process.env.ELECTRON_NO_ATTACH_CONSOLE) {
+ process.log(buf.toString());
+ }
cb();
}
});