diff options
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index e8cde74..64cd3b7 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -19,9 +19,14 @@ var AST = { this.hash = hash; this.strip = strip; - // Must use charAt to support IE pre-10 - var escapeFlag = open.charAt(3) || open.charAt(2); - this.escaped = escapeFlag !== '{' && escapeFlag !== '&'; + // Open may be a string parsed from the parser or a passed boolean flag + if (open != null && open.charAt) { + // Must use charAt to support IE pre-10 + var escapeFlag = open.charAt(3) || open.charAt(2); + this.escaped = escapeFlag !== '{' && escapeFlag !== '&'; + } else { + this.escaped = !!open; + } var id = this.id = rawParams[0]; var params = this.params = rawParams.slice(1); |