operations.less now passes

This commit is contained in:
cloudhead 2010-03-19 18:47:17 -04:00
parent 10965a9034
commit 5ee3d47e11
2 changed files with 14 additions and 7 deletions

View File

@ -5,13 +5,18 @@ tree.Operation = function Operation(op, operands) {
this.operands = operands;
};
tree.Operation.prototype.eval = function (env) {
var a = this.operands[0],
b = this.operands[1],
var a = this.operands[0].eval(env),
b = this.operands[1].eval(env),
temp;
if (a instanceof tree.Dimension) {
if (a instanceof tree.Dimension && b instanceof tree.Color) {
if (this.op === '*' || this.op === '+') {
temp = b, b = a, a = temp;
} else {
throw { name: "OperationError",
message: "Can't substract or divide a color from a number" };
}
return a.eval(env).operate(this.op, b.eval(env));
}
return a.operate(this.op, b);
};

View File

@ -16,9 +16,11 @@
height: 0px;
width: 4px;
}
.shorthands { padding: -1px 2px 0 -4px; }
.shorthands {
padding: -1px 2px 0 -4px;
}
.colors {
color: #112233;
color: #123;
border-color: #334455;
background-color: #000000;
}