readline: update 6 comparions to strict
PR-URL: https://github.com/nodejs/node/pull/11078 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
c5a0dcedd3
commit
b869ecaacf
@ -454,7 +454,7 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) {
|
|||||||
|
|
||||||
// this = Interface instance
|
// this = Interface instance
|
||||||
function handleGroup(self, group, width, maxColumns) {
|
function handleGroup(self, group, width, maxColumns) {
|
||||||
if (group.length == 0) {
|
if (group.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var minRows = Math.ceil(group.length / maxColumns);
|
var minRows = Math.ceil(group.length / maxColumns);
|
||||||
@ -479,7 +479,7 @@ function handleGroup(self, group, width, maxColumns) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function commonPrefix(strings) {
|
function commonPrefix(strings) {
|
||||||
if (!strings || strings.length == 0) {
|
if (!strings || strings.length === 0) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (strings.length === 1) return strings[0];
|
if (strings.length === 1) return strings[0];
|
||||||
@ -487,7 +487,7 @@ function commonPrefix(strings) {
|
|||||||
var min = sorted[0];
|
var min = sorted[0];
|
||||||
var max = sorted[sorted.length - 1];
|
var max = sorted[sorted.length - 1];
|
||||||
for (var i = 0, len = min.length; i < len; i++) {
|
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);
|
return min.slice(0, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -702,7 +702,7 @@ Interface.prototype._ttyWrite = function(s, key) {
|
|||||||
this._previousKey = key;
|
this._previousKey = key;
|
||||||
|
|
||||||
// Ignore escape key - Fixes #2876
|
// Ignore escape key - Fixes #2876
|
||||||
if (key.name == 'escape') return;
|
if (key.name === 'escape') return;
|
||||||
|
|
||||||
if (key.ctrl && key.shift) {
|
if (key.ctrl && key.shift) {
|
||||||
/* Control and shift pressed */
|
/* Control and shift pressed */
|
||||||
@ -783,7 +783,7 @@ Interface.prototype._ttyWrite = function(s, key) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'z':
|
case 'z':
|
||||||
if (process.platform == 'win32') break;
|
if (process.platform === 'win32') break;
|
||||||
if (this.listenerCount('SIGTSTP') > 0) {
|
if (this.listenerCount('SIGTSTP') > 0) {
|
||||||
this.emit('SIGTSTP');
|
this.emit('SIGTSTP');
|
||||||
} else {
|
} else {
|
||||||
@ -995,7 +995,7 @@ function emitKeypressEvents(stream, iface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onNewListener(event) {
|
function onNewListener(event) {
|
||||||
if (event == 'keypress') {
|
if (event === 'keypress') {
|
||||||
stream.on('data', onData);
|
stream.on('data', onData);
|
||||||
stream.removeListener('newListener', onNewListener);
|
stream.removeListener('newListener', onNewListener);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user