mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
double brackets does not leave brackets behind, to align with the most common scenarios
This commit is contained in:
@@ -4,7 +4,8 @@ tree.Expression = function (value) { this.value = value; };
|
||||
tree.Expression.prototype = {
|
||||
eval: function (env) {
|
||||
var returnValue,
|
||||
inParenthesis = this.parens && !this.parensInOp;
|
||||
inParenthesis = this.parens && !this.parensInOp,
|
||||
doubleParen = false;
|
||||
if (inParenthesis) {
|
||||
env.inParenthesis();
|
||||
}
|
||||
@@ -13,6 +14,9 @@ tree.Expression.prototype = {
|
||||
return e.eval(env);
|
||||
}));
|
||||
} else if (this.value.length === 1) {
|
||||
if (this.value[0].parens && !this.value[0].parensInOp) {
|
||||
doubleParen = true;
|
||||
}
|
||||
returnValue = this.value[0].eval(env);
|
||||
} else {
|
||||
returnValue = this;
|
||||
@@ -20,7 +24,7 @@ tree.Expression.prototype = {
|
||||
if (inParenthesis) {
|
||||
env.outOfParenthesis();
|
||||
}
|
||||
if (this.parens && this.parensInOp && !(env.isMathsOn())) {
|
||||
if (this.parens && this.parensInOp && !(env.isMathsOn()) && !doubleParen) {
|
||||
returnValue = new(tree.Paren)(returnValue);
|
||||
}
|
||||
return returnValue;
|
||||
|
||||
Reference in New Issue
Block a user