summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/util.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/lib/util.js b/scripts/lib/util.js
index c6836f72..59601686 100644
--- a/scripts/lib/util.js
+++ b/scripts/lib/util.js
@@ -21,4 +21,15 @@
}
});
}
+ if (Array.prototype.fastIndexOf === undefined) {
+ Object.defineProperty(Array.prototype, "fastIndexOf", {
+ value : function (v) {
+ for (var i=0, l=this.length; i<l; ++i) {
+ if (this[i] == v)
+ return i;
+ }
+ return -1;
+ }
+ });
+ }
})();