3 tree.Operation = function (op, operands) {
5 this.operands = operands;
7 tree.Operation.prototype.eval = function (env) {
8 var a = this.operands[0].eval(env),
9 b = this.operands[1].eval(env),
12 if (a instanceof tree.Dimension && b instanceof tree.Color) {
13 if (this.op === '*' || this.op === '+') {
14 temp = b, b = a, a = temp;
16 throw { name: "OperationError",
17 message: "Can't substract or divide a color from a number" };
20 return a.operate(this.op, b);
23 tree.operate = function (op, a, b) {
25 case '+': return a + b;
26 case '-': return a - b;
27 case '*': return a * b;
28 case '/': return a / b;
32 })(require('less/tree'));