diff --git a/lib/director/browser.js b/lib/director/browser.js index 1e47293..3ec0041 100644 --- a/lib/director/browser.js +++ b/lib/director/browser.js @@ -6,6 +6,28 @@ * */ +Array.isArray = Array.isArray || function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; +}; + +Array.prototype.filter = Array.prototype.filter || function(fun){ + var len = this.length; + if (typeof fun != "function"){ + throw new TypeError(); + } + var res = new Array(); + var thisp = arguments[1]; + for (var i = 0; i < len; i++){ + if (i in this){ + var val = this[i]; + if (fun.call(thisp, val, i, this)) { + res.push(val); + } + } + } + return res; +}; + var dloc = document.location; function dlocHashEmpty() {