From 6ed19e7864fab3fafdbf0e1f817b6c46d42069e3 Mon Sep 17 00:00:00 2001 From: Voltrex Date: Mon, 28 Jun 2021 02:42:16 +0430 Subject: [PATCH] readline: use logical assignment operators With the addition of the new logical assignment operators (`||=`, `??=` and `&&=`), we could use it here. --- lib/readline.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index b40c8019746120..376c079ed6bd6c 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -975,7 +975,7 @@ Interface.prototype._moveCursor = function(dx) { }; function _ttyWriteDumb(s, key) { - key = key || {}; + key ||= {}; if (key.name === 'escape') return; @@ -1025,7 +1025,7 @@ function _ttyWriteDumb(s, key) { // Handle a write from the tty Interface.prototype._ttyWrite = function(s, key) { const previousKey = this._previousKey; - key = key || {}; + key ||= {}; this._previousKey = key; // Activate or deactivate substring search.