[Pkg-javascript-commits] [less.js] 13/38: Merge branch 'hotfix/isunit-empty' of https://github.com/chromice/less.js
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:27:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v2.2.0
in repository less.js.
commit 6b88f31ed57732ca0d6aeb6117d30f5002c543e3
Merge: 4704583 ab8deae
Author: Luke Page <luke.a.page at gmail.com>
Date: Thu Jan 1 17:56:36 2015 +0000
Merge branch 'hotfix/isunit-empty' of https://github.com/chromice/less.js
Conflicts:
lib/less/functions/types.js
lib/less/functions/types.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --cc lib/less/functions/types.js
index fd3dab0,6592aea..42a5190
--- a/lib/less/functions/types.js
+++ b/lib/less/functions/types.js
@@@ -11,7 -11,10 +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." };
+ }
- return (n instanceof Dimension) && n.unit.is(unit.value !== undefined ? unit.value : unit) ? Keyword.True : Keyword.False;
++ 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) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list