diff options
author | Rich Trott <rtrott@gmail.com> | 2017-06-20 14:37:00 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-06-23 14:43:20 -0700 |
commit | 095c0de94d818088cacf2c33ad4913768c15024a (patch) | |
tree | 77eb0aaffa2aa80ba1240280a716eb64c4a7ff1d /lib/_http_outgoing.js | |
parent | e3ea0fc97bf3a911463275446024b50e8bae865f (diff) | |
download | android-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.tar.gz android-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.tar.bz2 android-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.zip |
benchmark,lib,test: use braces for multiline block
For if/else and loops where the bodies span more than one line, use
curly braces.
PR-URL: https://github.com/nodejs/node/pull/13828
Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r-- | lib/_http_outgoing.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 636afc4e46..ccb66f742f 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -219,12 +219,13 @@ OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { // any messages, before ever calling this. In that case, just skip // it, since something else is destroying this connection anyway. OutgoingMessage.prototype.destroy = function destroy(error) { - if (this.socket) + if (this.socket) { this.socket.destroy(error); - else + } else { this.once('socket', function(socket) { socket.destroy(error); }); + } }; @@ -505,8 +506,7 @@ function matchHeader(self, state, field, value) { function validateHeader(msg, name, value) { if (typeof name !== 'string' || !name || !checkIsHttpToken(name)) - throw new TypeError( - 'Header name must be a valid HTTP Token ["' + name + '"]'); + throw new TypeError(`Header name must be a valid HTTP Token ["${name}"]`); if (value === undefined) throw new Error('"value" required in setHeader("' + name + '", value)'); if (msg._header) |