Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
readline: use logical assignment operators
With the addition of the new logical assignment operators (`||=`, `??=` and `&&=`), we could use it here.
  • Loading branch information
VoltrexKeyva authored Jun 27, 2021
commit 6ed19e7864fab3fafdbf0e1f817b6c46d42069e3
4 changes: 2 additions & 2 deletions lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ Interface.prototype._moveCursor = function(dx) {
};

function _ttyWriteDumb(s, key) {
key = key || {};
key ||= {};

if (key.name === 'escape') return;

Expand Down Expand Up @@ -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.
Expand Down