From d1375ad9eff171d39bc80399b7b1d2bd08a6c5d5 Mon Sep 17 00:00:00 2001 From: Umair Ishaq Date: Tue, 31 Jan 2017 00:40:19 -0500 Subject: [PATCH] readline: update 6 comparions to strict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/11078 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso --- lib/readline.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index c973c92260ff98..85a64222fb6719 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -458,7 +458,7 @@ Interface.prototype._tabComplete = function() { // this = Interface instance function handleGroup(self, group, width, maxColumns) { - if (group.length == 0) { + if (group.length === 0) { return; } var minRows = Math.ceil(group.length / maxColumns); @@ -483,14 +483,14 @@ function handleGroup(self, group, width, maxColumns) { } function commonPrefix(strings) { - if (!strings || strings.length == 0) { + if (!strings || strings.length === 0) { return ''; } var sorted = strings.slice().sort(); var min = sorted[0]; var max = sorted[sorted.length - 1]; for (var i = 0, len = min.length; i < len; i++) { - if (min[i] != max[i]) { + if (min[i] !== max[i]) { return min.slice(0, i); } } @@ -703,7 +703,7 @@ Interface.prototype._ttyWrite = function(s, key) { key = key || {}; // Ignore escape key - Fixes #2876 - if (key.name == 'escape') return; + if (key.name === 'escape') return; if (key.ctrl && key.shift) { /* Control and shift pressed */ @@ -784,7 +784,7 @@ Interface.prototype._ttyWrite = function(s, key) { break; case 'z': - if (process.platform == 'win32') break; + if (process.platform === 'win32') break; if (this.listenerCount('SIGTSTP') > 0) { this.emit('SIGTSTP'); } else { @@ -995,7 +995,7 @@ function emitKeypressEvents(stream, iface) { } function onNewListener(event) { - if (event == 'keypress') { + if (event === 'keypress') { stream.on('data', onData); stream.removeListener('newListener', onNewListener); }