Merge branch 'hotfix/isunit-empty' of https://github.com/chromice/less.js

Conflicts:
	lib/less/functions/types.js
This commit is contained in:
Luke Page
2015-01-01 17:56:36 +00:00

View File

@@ -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) {