Fix handling of boolean escape in MustacheNode

Fixes issue with Ember compatibility due to direct instantiation of MustacheNode.
This commit is contained in:
kpdecker
2013-12-23 19:02:24 -06:00
parent ca8e34c94d
commit b4968bb8d4
+8 -3
View File
@@ -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);