mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #60 Don't replace special operators when for body functions
This commit is contained in:
parent
2252b54a2b
commit
be1072a146
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user