mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Handle the missing second argument to isunit() with an appropriate error message.
This commit is contained in:
@@ -11,6 +11,9 @@ var isa = function (n, Type) {
|
||||
return (n instanceof Type) ? Keyword.True : Keyword.False;
|
||||
},
|
||||
isunit = function (n, unit) {
|
||||
if (unit === undefined) {
|
||||
throw { type: "Argument", message: "missing the required second argument to isunit." };
|
||||
}
|
||||
return (n instanceof Dimension) && n.unit.is(unit.value !== undefined ? unit.value : unit) ? Keyword.True : Keyword.False;
|
||||
};
|
||||
functionRegistry.addMultiple({
|
||||
|
||||
Reference in New Issue
Block a user