mirror of
https://github.com/less/less.js.git
synced 2026-02-17 18:31:32 -05:00
18 lines
494 B
JavaScript
18 lines
494 B
JavaScript
if (typeof(window) === 'undefined') { var tree = require(require('path').join(__dirname, '..', '..', 'less', 'tree')); }
|
|
|
|
tree.Operation = function Operation(op, operands) {
|
|
this.op = op.trim();
|
|
this.operands = operands;
|
|
};
|
|
tree.Operation.prototype.eval = function (env) {
|
|
var a = this.operands[0],
|
|
b = this.operands[1],
|
|
temp;
|
|
|
|
if (a instanceof tree.Dimension) {
|
|
temp = b, b = a, a = temp;
|
|
}
|
|
return a.eval(env).operate(this.op, b.eval(env));
|
|
};
|
|
|