From 5524133fbff0ab588585c5cdfbe872f95145e639 Mon Sep 17 00:00:00 2001 From: jos Date: Thu, 19 Jun 2014 09:46:33 +0200 Subject: [PATCH] Fixed #170: unreliable Array type detection --- src/DataSet.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DataSet.js b/src/DataSet.js index 71ad59a5..9ec557fc 100644 --- a/src/DataSet.js +++ b/src/DataSet.js @@ -158,7 +158,7 @@ DataSet.prototype.add = function (data, senderId) { id, me = this; - if (data instanceof Array) { + if (Array.isArray(data)) { // Array for (var i = 0, len = data.length; i < len; i++) { id = me._addItem(data[i]); @@ -221,7 +221,7 @@ DataSet.prototype.update = function (data, senderId) { } }; - if (data instanceof Array) { + if (Array.isArray(data)) { // Array for (var i = 0, len = data.length; i < len; i++) { addOrUpdate(data[i]); @@ -644,7 +644,7 @@ DataSet.prototype.remove = function (id, senderId) { var removedIds = [], i, len, removedId; - if (id instanceof Array) { + if (Array.isArray(id)) { for (i = 0, len = id.length; i < len; i++) { removedId = this._remove(id[i]); if (removedId != null) {