summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/utils.js')
-rw-r--r--lib/handlebars/utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index 8cea50d..fc2b846 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -48,6 +48,16 @@ export var isArray = Array.isArray || function(value) {
return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
};
+// Older IE versions do not directly support indexOf so we must implement our own, sadly.
+export function indexOf(array, value) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (array[i] === value) {
+ return i;
+ }
+ }
+ return -1;
+}
+
export function escapeExpression(string) {
// don't escape SafeStrings, since they're already safe