diff options
author | cjihrig <cjihrig@gmail.com> | 2015-01-28 20:05:53 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-01-31 23:47:29 -0500 |
commit | 6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40 (patch) | |
tree | 29a3b1ce92cfad3ae5d41a4ba7451846beace950 /lib/_http_incoming.js | |
parent | bce7a2608eb198eee6ecd7991062efd6daeeb440 (diff) | |
download | android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.tar.gz android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.tar.bz2 android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.zip |
lib: reduce util.is*() usage
Many of the util.is*() methods used to check data types
simply compare against a single value or the result of
typeof. This commit replaces calls to these methods with
equivalent checks. This commit does not touch calls to the
more complex methods (isRegExp(), isDate(), etc.).
Fixes: https://github.com/iojs/io.js/issues/607
PR-URL: https://github.com/iojs/io.js/pull/647
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r-- | lib/_http_incoming.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index e35457ce5e..41ece371cd 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -130,7 +130,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) { switch (field) { // Array headers: case 'set-cookie': - if (!util.isUndefined(dest[field])) { + if (dest[field] !== undefined) { dest[field].push(value); } else { dest[field] = [value]; @@ -152,13 +152,13 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) { case 'location': case 'max-forwards': // drop duplicates - if (util.isUndefined(dest[field])) + if (dest[field] === undefined) dest[field] = value; break; default: // make comma-separated list - if (!util.isUndefined(dest[field])) + if (dest[field] !== undefined) dest[field] += ', ' + value; else { dest[field] = value; |