summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorportix <none@none>2012-08-21 14:57:34 +0200
committerportix <none@none>2012-08-21 14:57:34 +0200
commitcf3566fbe3df4583b54409c188362b7dd4b40c9b (patch)
treea607ba8c529dcb2d6dbc8d63a7996b60673ffcec /scripts
parent1b71e3d1bf57a002fb9faaa5b0d964d412e0b7e8 (diff)
downloaddwb-cf3566fbe3df4583b54409c188362b7dd4b40c9b.zip
Implementing Array.fastIndexOf; adding dwb-js-manpage
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;
+ }
+ });
+ }
})();