mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Merge branch 'hotfix/isunit-empty' of https://github.com/chromice/less.js
Conflicts: lib/less/functions/types.js
This commit is contained in:
@@ -11,7 +11,14 @@ var isa = function (n, Type) {
|
||||
return (n instanceof Type) ? Keyword.True : Keyword.False;
|
||||
},
|
||||
isunit = function (n, unit) {
|
||||
return (n instanceof Dimension) && n.unit.is(typeof unit.value === "string" ? unit.value : unit) ? Keyword.True : Keyword.False;
|
||||
if (unit === undefined) {
|
||||
throw { type: "Argument", message: "missing the required second argument to isunit." };
|
||||
}
|
||||
unit = typeof unit.value === "string" ? unit.value : unit;
|
||||
if (typeof unit !== "string") {
|
||||
throw { type: "Argument", message: "Second argument to isunit should be a unit or a string." };
|
||||
}
|
||||
return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;
|
||||
};
|
||||
functionRegistry.addMultiple({
|
||||
iscolor: function (n) {
|
||||
|
||||
Reference in New Issue
Block a user