Fixes #60 Don't replace special operators when for body functions

This commit is contained in:
Patrick Steele-Idem 2015-04-08 12:19:30 -06:00
parent 2252b54a2b
commit be1072a146
3 changed files with 6 additions and 6 deletions

View File

@ -96,7 +96,7 @@ CodeWriter.prototype = {
if (typeof code === 'function') {
code = code();
}
this.flush();
this._code.append(code);
},
@ -514,8 +514,8 @@ TemplateBuilder.prototype = {
setTemplateName: function (templateName) {
this.templateName = templateName;
},
makeExpression: function (expression) {
return this.compiler.makeExpression(expression);
makeExpression: function (expression, replaceSpecialOperators) {
return this.compiler.makeExpression(expression, replaceSpecialOperators);
},
hasExpression: function (str) {
return this.compiler.hasExpression(str);

View File

@ -164,11 +164,11 @@ TemplateCompiler.prototype = {
hasExpression: function(str) {
return expressionParser.hasExpression(str);
},
makeExpression: function (expression) {
makeExpression: function (expression, replaceSpecialOperators) {
if (this.isExpression(expression)) {
return expression;
} else {
return new Expression(expression);
return new Expression(expression, replaceSpecialOperators);
}
},
parseExpression: function(str, listeners, options) {

View File

@ -42,7 +42,7 @@ function getPropsStr(props, template) {
throw new Error('Invalid value for property "' + name + '"');
}
value = template.makeExpression(value);
value = template.makeExpression(value, false);
}
if (template.isExpression(value)) {