Fix error message when performing an operation on a keyword

This commit is contained in:
Luke Page
2012-10-25 07:45:11 +01:00
parent f3a6761dc5
commit df20aae183

View File

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