Files
less.js/lib/less/node/operation.js

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));
};