@@ -52,7 +52,7 @@ function Console(stdout, stderr, ignoreErrors = true) {
52
52
Object.defineProperty(this, '_stdout', prop);
53
53
prop.value = stderr;
54
54
Object.defineProperty(this, '_stderr', prop);
55
- prop.value = ignoreErrors;
55
+ prop.value = Boolean( ignoreErrors) ;
56
56
Object.defineProperty(this, '_ignoreErrors', prop);
57
57
prop.value = new Map();
58
58
Object.defineProperty(this, '_times', prop);
@@ -80,7 +80,7 @@ function createWriteErrorHandler(stream) {
80
80
// This conditional evaluates to true if and only if there was an error
81
81
// that was not already emitted (which happens when the _write callback
82
82
// is invoked asynchronously).
83
- if (err && !stream._writableState.errorEmitted) {
83
+ if (err !== null && !stream._writableState.errorEmitted) {
84
84
// If there was an error, it will be emitted on `stream` as
85
85
// an `error` event. Adding a `once` listener will keep that error
86
86
// from becoming an uncaught exception, but since the handler is
@@ -102,7 +102,7 @@ function write(ignoreErrors, stream, string, errorhandler, groupIndent) {
102
102
}
103
103
string += '\n';
104
104
105
- if (! ignoreErrors) return stream.write(string);
105
+ if (ignoreErrors === false ) return stream.write(string);
106
106
107
107
// There may be an error occurring synchronously (e.g. for files or TTYs
108
108
// on POSIX systems) or asynchronously (e.g. pipes on POSIX systems), so
0 commit comments