diff --git a/lib/events.js b/lib/events.js index 742b629d87fcc1..dce1dc48fa42e8 100644 --- a/lib/events.js +++ b/lib/events.js @@ -262,8 +262,8 @@ function _addListener(target, type, listener, prepend) { } else { if (typeof existing === 'function') { // Adding the second element, need to change to array. - existing = events[type] = prepend ? [listener, existing] : - [existing, listener]; + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; } else { // If we've already got an array, just append. if (prepend) { diff --git a/lib/internal/freelist.js b/lib/internal/freelist.js index 1096bb2b8e09ba..7e9cef9528ab75 100644 --- a/lib/internal/freelist.js +++ b/lib/internal/freelist.js @@ -9,8 +9,9 @@ class FreeList { } alloc() { - return this.list.length ? this.list.pop() : - this.ctor.apply(this, arguments); + return this.list.length ? + this.list.pop() : + this.ctor.apply(this, arguments); } free(obj) { diff --git a/lib/net.js b/lib/net.js index 5129a596421e1c..27df6253f16145 100644 --- a/lib/net.js +++ b/lib/net.js @@ -64,7 +64,7 @@ function createHandle(fd) { function getNewAsyncId(handle) { return (!handle || typeof handle.getAsyncId !== 'function') ? - newUid() : handle.getAsyncId(); + newUid() : handle.getAsyncId(); } diff --git a/lib/url.js b/lib/url.js index bc59b8827a1dc0..ab82cc2abbd8e8 100644 --- a/lib/url.js +++ b/lib/url.js @@ -825,8 +825,8 @@ Url.prototype.resolveObject = function resolveObject(relative) { //occasionally the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - const authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; + const authInHost = + result.host && result.host.indexOf('@') > 0 && result.host.split('@'); if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); @@ -902,13 +902,13 @@ Url.prototype.resolveObject = function resolveObject(relative) { // put the host back if (noLeadingSlashes) { - result.hostname = result.host = isAbsolute ? '' : - srcPath.length ? srcPath.shift() : ''; + result.hostname = + result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occasionally the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') const authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; + result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift();