diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-07-15 01:29:28 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-07-15 21:35:29 +0400 |
commit | 6a57a42109503b5327c4ffca20fe4048103c3b80 (patch) | |
tree | 2fe3d8aaad9876e279a41ba8d942085dad8b0e6b /lib/http.js | |
parent | 3a00470dbb0ac1ead14b52624b16e917e522fddf (diff) |
Use Array.isArray instead of instanceof
Diffstat (limited to 'lib/http.js')
-rw-r--r-- | lib/http.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js index 1f3537b6510..66869740ec3 100644 --- a/lib/http.js +++ b/lib/http.js @@ -359,7 +359,7 @@ OutgoingMessage.prototype._storeHeader = function (firstLine, headers) { if (headers) { var keys = Object.keys(headers); - var isArray = (headers instanceof Array); + var isArray = (Array.isArray(headers)); for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; if (isArray) { @@ -1036,7 +1036,7 @@ exports.cat = function (url, encoding_, headers_) { var url = require("url").parse(url); var hasHost = false; - if (headers instanceof Array) { + if (Array.isArray(headers)) { for (var i = 0, l = headers.length; i < l; i++) { if (headers[i][0].toLowerCase() === 'host') { hasHost = true; |