[Pkg-javascript-commits] [less.js] 03/38: Handle the missing second argument to isunit() with an appropriate error message.

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:27:23 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 ab8deae516f3bdf9e5cb646782f5b0529805d555
Author: Anton Muraviev <chromice at gmail.com>
Date:   Sun Dec 7 12:45:50 2014 +0000

    Handle the missing second argument to isunit() with an appropriate error message.
---
 lib/less/functions/types.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/less/functions/types.js b/lib/less/functions/types.js
index dbb7553..6592aea 100644
--- a/lib/less/functions/types.js
+++ b/lib/less/functions/types.js
@@ -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({

-- 
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