carto/lib/less/tree/expression.js

22 lines
542 B
JavaScript
Raw Normal View History

(function (tree) {
tree.Expression = function Expression(value) { this.value = value };
2010-03-08 12:38:10 +08:00
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);
2010-02-24 02:39:05 +08:00
}
2010-03-08 12:38:10 +08:00
},
toCSS: function () {
return this.value.map(function (e) {
return e.toCSS();
}).join(' ');
2010-03-08 12:38:10 +08:00
}
2010-02-24 02:39:05 +08:00
};
})(require('less/tree'));