diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-03-02 02:44:18 +0000 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-03-04 15:33:18 +0100 |
commit | f2d93795bfe61a3260bf743d2247b56b83fc6f70 (patch) | |
tree | 2edc3c4ced9bc6309e3a93c3af474adf16933187 /lib | |
parent | 7bc8eb8da7ccdcd67edaf612b6599ec04ab77cb1 (diff) | |
download | android-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.tar.gz android-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.tar.bz2 android-node-v8-f2d93795bfe61a3260bf743d2247b56b83fc6f70.zip |
lib,test: remove yoda statements
PR-URL: https://github.com/nodejs/node/pull/18746
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_stream_readable.js | 2 | ||||
-rw-r--r-- | lib/internal/readline.js | 30 | ||||
-rw-r--r-- | lib/internal/streams/legacy.js | 6 |
3 files changed, 18 insertions, 20 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 5cdc0864a0..ba231ccda9 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -838,7 +838,7 @@ function resume_(stream, state) { Readable.prototype.pause = function() { debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { + if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); diff --git a/lib/internal/readline.js b/lib/internal/readline.js index e3d3007a75..979e62090b 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -87,33 +87,33 @@ if (process.binding('config').hasIntl) { if ( code >= 0x1100 && ( code <= 0x115f || // Hangul Jamo - 0x2329 === code || // LEFT-POINTING ANGLE BRACKET - 0x232a === code || // RIGHT-POINTING ANGLE BRACKET + code === 0x2329 || // LEFT-POINTING ANGLE BRACKET + code === 0x232a || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= code && code <= 0x3247 && code !== 0x303f) || + code >= 0x2e80 && code <= 0x3247 && code !== 0x303f || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - 0x3250 <= code && code <= 0x4dbf || + code >= 0x3250 && code <= 0x4dbf || // CJK Unified Ideographs .. Yi Radicals - 0x4e00 <= code && code <= 0xa4c6 || + code >= 0x4e00 && code <= 0xa4c6 || // Hangul Jamo Extended-A - 0xa960 <= code && code <= 0xa97c || + code >= 0xa960 && code <= 0xa97c || // Hangul Syllables - 0xac00 <= code && code <= 0xd7a3 || + code >= 0xac00 && code <= 0xd7a3 || // CJK Compatibility Ideographs - 0xf900 <= code && code <= 0xfaff || + code >= 0xf900 && code <= 0xfaff || // Vertical Forms - 0xfe10 <= code && code <= 0xfe19 || + code >= 0xfe10 && code <= 0xfe19 || // CJK Compatibility Forms .. Small Form Variants - 0xfe30 <= code && code <= 0xfe6b || + code >= 0xfe30 && code <= 0xfe6b || // Halfwidth and Fullwidth Forms - 0xff01 <= code && code <= 0xff60 || - 0xffe0 <= code && code <= 0xffe6 || + code >= 0xff01 && code <= 0xff60 || + code >= 0xffe0 && code <= 0xffe6 || // Kana Supplement - 0x1b000 <= code && code <= 0x1b001 || + code >= 0x1b000 && code <= 0x1b001 || // Enclosed Ideographic Supplement - 0x1f200 <= code && code <= 0x1f251 || + code >= 0x1f200 && code <= 0x1f251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - 0x20000 <= code && code <= 0x3fffd + code >= 0x20000 && code <= 0x3fffd ) ) { return true; diff --git a/lib/internal/streams/legacy.js b/lib/internal/streams/legacy.js index 3242b15eab..9790696bfc 100644 --- a/lib/internal/streams/legacy.js +++ b/lib/internal/streams/legacy.js @@ -12,10 +12,8 @@ Stream.prototype.pipe = function(dest, options) { var source = this; function ondata(chunk) { - if (dest.writable) { - if (false === dest.write(chunk) && source.pause) { - source.pause(); - } + if (dest.writable && dest.write(chunk) === false && source.pause) { + source.pause(); } } |