mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Ensure error thrown uses 'type' not 'name'
This commit is contained in:
@@ -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" };
|
||||
}
|
||||
|
||||
|
||||
3
test/less/errors/color-operation-error.less
Normal file
3
test/less/errors/color-operation-error.less
Normal file
@@ -0,0 +1,3 @@
|
||||
.a {
|
||||
prop: (3 / #fff);
|
||||
}
|
||||
2
test/less/errors/color-operation-error.txt
Normal file
2
test/less/errors/color-operation-error.txt
Normal 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);
|
||||
Reference in New Issue
Block a user