mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
23 lines
560 B
JavaScript
23 lines
560 B
JavaScript
(function (tree) {
|
|
|
|
tree.Assignment = function (key, val) {
|
|
this.key = key;
|
|
this.value = val;
|
|
};
|
|
tree.Assignment.prototype = {
|
|
type: "Assignment",
|
|
accept: function (visitor) {
|
|
this.value = visitor.visit(this.value);
|
|
},
|
|
toCSS: function () {
|
|
return this.key + '=' + (this.value.toCSS ? this.value.toCSS() : this.value);
|
|
},
|
|
eval: function (env) {
|
|
if (this.value.eval) {
|
|
return new(tree.Assignment)(this.key, this.value.eval(env));
|
|
}
|
|
return this;
|
|
}
|
|
};
|
|
|
|
})(require('../tree')); |