From f6e332da2dbaa03906c93f98285d388885af13ed Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 8 Jul 2016 17:17:47 -0700 Subject: [PATCH] lib: implement consistent brace style This change is in preparation for lint-enforced brace style. PR-URL: https://github.com/nodejs/node/pull/8348 Reviewed-By: James M Snell Reviewed-By: Myles Borins --- lib/_stream_readable.js | 8 +++++--- lib/module.js | 3 +-- lib/net.js | 3 +-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index c9beafa9bee8e7..a6e5c5d46f05fe 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -802,9 +802,11 @@ Readable.prototype.wrap = function(stream) { // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }; }(i); + this[i] = function(method) { + return function() { + return stream[method].apply(stream, arguments); + }; + }(i); } } diff --git a/lib/module.js b/lib/module.js index 141ee18ddb9f8a..36e0b160c99038 100644 --- a/lib/module.js +++ b/lib/module.js @@ -488,8 +488,7 @@ Module._preloadModules = function(requests) { var parent = new Module('internal/preload', null); try { parent.paths = Module._nodeModulePaths(process.cwd()); - } - catch (e) { + } catch (e) { if (e.code !== 'ENOENT') { throw e; } diff --git a/lib/net.js b/lib/net.js index f32af94fbf94e1..4a71fada719049 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1155,8 +1155,7 @@ function createServerHandle(address, port, addressType, fd) { if (typeof fd === 'number' && fd >= 0) { try { handle = createHandle(fd); - } - catch (e) { + } catch (e) { // Not a fd we can listen on. This will trigger an error. debug('listen invalid fd=' + fd + ': ' + e.message); return uv.UV_EINVAL;