Ensure error thrown uses 'type' not 'name'

This commit is contained in:
Luke Page
2013-02-03 11:55:34 +00:00
parent aecab5e7dd
commit d9d959fd21
3 changed files with 7 additions and 2 deletions

View File

@@ -15,12 +15,12 @@ tree.Operation.prototype.eval = function (env) {
if (this.op === '*' || this.op === '+') {
temp = b, b = a, a = temp;
} else {
throw { name: "OperationError",
throw { type: "Operation",
message: "Can't substract or divide a color from a number" };
}
}
if (!a.operate) {
throw { name: "OperationError",
throw { type: "Operation",
message: "Operation on an invalid type" };
}

View File

@@ -0,0 +1,3 @@
.a {
prop: (3 / #fff);
}

View File

@@ -0,0 +1,2 @@
OperationError: Can't substract or divide a color from a number in {path}color-operation-error.less:null:-1
1 prop: (3 / #fff);