mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
28 lines
707 B
JavaScript
28 lines
707 B
JavaScript
var Node = require("./node");
|
|
|
|
var Assignment = function (key, val) {
|
|
this.key = key;
|
|
this.value = val;
|
|
};
|
|
|
|
Assignment.prototype = new Node();
|
|
Assignment.prototype.type = "Assignment";
|
|
Assignment.prototype.accept = function (visitor) {
|
|
this.value = visitor.visit(this.value);
|
|
};
|
|
Assignment.prototype.eval = function (context) {
|
|
if (this.value.eval) {
|
|
return new Assignment(this.key, this.value.eval(context));
|
|
}
|
|
return this;
|
|
};
|
|
Assignment.prototype.genCSS = function (context, output) {
|
|
output.add(this.key + '=');
|
|
if (this.value.genCSS) {
|
|
this.value.genCSS(context, output);
|
|
} else {
|
|
output.add(this.value);
|
|
}
|
|
};
|
|
module.exports = Assignment;
|