Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-07-15 01:29:28 +0400
committerRyan Dahl <ry@tinyclouds.org>2010-07-15 21:35:29 +0400
commit6a57a42109503b5327c4ffca20fe4048103c3b80 (patch)
tree2fe3d8aaad9876e279a41ba8d942085dad8b0e6b /lib/http.js
parent3a00470dbb0ac1ead14b52624b16e917e522fddf (diff)
Use Array.isArray instead of instanceof
Diffstat (limited to 'lib/http.js')
-rw-r--r--lib/http.js4
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;