Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
lib: implement consistent brace style
This change is in preparation for lint-enforced brace style.
  • Loading branch information
Trott committed Jul 9, 2016
commit a3480b2b69df9e83d1bc0c527beadf82a8947232
8 changes: 5 additions & 3 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this change, but I think one level of function wrapping can be removed here:

this[i] = function(method) {
  return stream[method].apply(stream, arguments);
}(i);

}
}

Expand Down
3 changes: 1 addition & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,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;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,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;
Expand Down