summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/tty.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/tty.js')
-rw-r--r--ext/node/polyfills/tty.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/node/polyfills/tty.js b/ext/node/polyfills/tty.js
index 2e8ecc8e1..e906c5f67 100644
--- a/ext/node/polyfills/tty.js
+++ b/ext/node/polyfills/tty.js
@@ -113,7 +113,10 @@ export class WriteStream extends Socket {
* @returns {boolean}
*/
hasColors(count, env) {
- if (env === undefined && typeof count === "object") {
+ if (
+ env === undefined &&
+ (count === undefined || typeof count === "object" && count !== null)
+ ) {
env = count;
count = 16;
}