summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-12-23 02:18:57 -0600
committerkpdecker <kpdecker@gmail.com>2013-12-23 02:18:57 -0600
commit3daef9d30897a7cca7a471ad5f21b955ff54b131 (patch)
treee231b1518a1143c6d63567e1fac369bb9c7c27de /lib/handlebars/compiler/ast.js
parent7f0ded4926be2f5c574e9a3d2187f85f0e0c5bbc (diff)
downloadhandlebars.js-3daef9d30897a7cca7a471ad5f21b955ff54b131.zip
handlebars.js-3daef9d30897a7cca7a471ad5f21b955ff54b131.tar.gz
handlebars.js-3daef9d30897a7cca7a471ad5f21b955ff54b131.tar.bz2
Use charAt rather than string index
Older versions of IE do not support [] access to string contents so charAt must be used. Fixes #677
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index b059cc1..e8cde74 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -19,7 +19,8 @@ var AST = {
this.hash = hash;
this.strip = strip;
- var escapeFlag = open[3] || open[2];
+ // Must use charAt to support IE pre-10
+ var escapeFlag = open.charAt(3) || open.charAt(2);
this.escaped = escapeFlag !== '{' && escapeFlag !== '&';
var id = this.id = rawParams[0];