carto/lib/less/tree/expression.js
2010-07-08 00:22:01 +02:00

22 lines
538 B
JavaScript

(function (tree) {
tree.Expression = function (value) { this.value = value };
tree.Expression.prototype = {
eval: function (env) {
if (this.value.length > 1) {
return new(tree.Expression)(this.value.map(function (e) {
return e.eval(env);
}));
} else {
return this.value[0].eval(env);
}
},
toCSS: function (env) {
return this.value.map(function (e) {
return e.toCSS(env);
}).join(' ');
}
};
})(require('less/tree'));