diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-24 18:03:53 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-24 21:49:35 +0200 |
commit | 0330bdf5195eb77f04c26a09a8bd2088a261fe53 (patch) | |
tree | 2c13f9f1757bca93e83e425a028dcae78549f40e /lib/_http_incoming.js | |
parent | 457d52924152c6f2baf2fddbe76a03bca7bdde7c (diff) | |
download | android-node-v8-0330bdf5195eb77f04c26a09a8bd2088a261fe53.tar.gz android-node-v8-0330bdf5195eb77f04c26a09a8bd2088a261fe53.tar.bz2 android-node-v8-0330bdf5195eb77f04c26a09a8bd2088a261fe53.zip |
lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r-- | lib/_http_incoming.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index c089ec9e24..f11d098031 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -125,7 +125,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) { switch (field) { // Array headers: case 'set-cookie': - if (dest[field] !== undefined) { + if (!IS_UNDEFINED(dest[field])) { dest[field].push(value); } else { dest[field] = [value]; @@ -145,7 +145,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) { case 'proxy-authenticate': case 'sec-websocket-extensions': case 'sec-websocket-protocol': - if (dest[field] !== undefined) { + if (!IS_UNDEFINED(dest[field])) { dest[field] += ', ' + value; } else { dest[field] = value; @@ -156,14 +156,14 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) { default: if (field.slice(0, 2) == 'x-') { // except for x- - if (dest[field] !== undefined) { + if (!IS_UNDEFINED(dest[field])) { dest[field] += ', ' + value; } else { dest[field] = value; } } else { // drop duplicates - if (dest[field] === undefined) dest[field] = value; + if (IS_UNDEFINED(dest[field])) dest[field] = value; } break; } |