diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-05-01 13:51:20 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-05-01 16:08:41 -0400 |
commit | 03fed07bdc2bbd1324afa0e838e4d83a4f7cfa8b (patch) | |
tree | 5f25c97a1fd0a2a05a87487e1ddc547093503567 | |
parent | 64c92989283e2a710776d8b10f0566f0a2cf5663 (diff) | |
download | mongo-03fed07bdc2bbd1324afa0e838e4d83a4f7cfa8b.tar.gz |
SERVER-18284 use plain Array.isArray instead of polyfills
-rw-r--r-- | src/mongo/shell/mongo.js | 6 | ||||
-rw-r--r-- | src/mongo/shell/types.js | 6 |
2 files changed, 1 insertions, 11 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index 6b5891bf3ee..41f5b1fe978 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -149,10 +149,6 @@ Mongo.prototype.getReadPrefTagSet = function () { return this._readPrefTagSet; }; -var isArray = function(maybeArray) { - return Object.prototype.toString.call(maybeArray) === '[object Array]'; -}; - // Returns a readPreference object of the type expected by mongos. Mongo.prototype.getReadPref = function () { var obj = {}, mode, tagSet; @@ -164,7 +160,7 @@ Mongo.prototype.getReadPref = function () { } // Server Selection Spec: - if readPref mode is "primary" then the tags field MUST // be absent. Ensured by setReadPref. - if (isArray(tagSet = this.getReadPrefTagSet())) { + if (Array.isArray(tagSet = this.getReadPrefTagSet())) { obj.tags = tagSet; } diff --git a/src/mongo/shell/types.js b/src/mongo/shell/types.js index 6ade032f65e..af529d63a1a 100644 --- a/src/mongo/shell/types.js +++ b/src/mongo/shell/types.js @@ -214,12 +214,6 @@ Array.stdDev = function(arr){ return Math.sqrt(sum / arr.length); } -if (typeof Array.isArray != "function"){ - Array.isArray = function(arr){ - return arr != undefined && arr.constructor == Array - } -} - // Object Object.extend = function(dst, src, deep){ for (var k in src){ |