mirror of
https://github.com/less/less.js.git
synced 2026-02-09 22:45:28 -05:00
16 lines
372 B
JavaScript
16 lines
372 B
JavaScript
node.Operation = function Operation(op, operands) {
|
|
this.op = op.trim();
|
|
this.operands = operands;
|
|
};
|
|
node.Operation.prototype.eval = function (env) {
|
|
var a = this.operands[0],
|
|
b = this.operands[1],
|
|
temp;
|
|
|
|
if (a instanceof node.Dimension) {
|
|
temp = b, b = a, a = temp;
|
|
}
|
|
return a.eval(env).operate(this.op, b.eval(env));
|
|
};
|
|
|