[Pkg-javascript-commits] [less.js] 78/88: call callback if exception whilst calling toCSS. Fixes #1816

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:22:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v1.7.0
in repository less.js.

commit 89e095cbf1ed13fe2fbea5d61aa334d952819897
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Feb 23 14:52:21 2014 +0000

    call callback if exception whilst calling toCSS. Fixes #1816
---
 lib/less/index.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/less/index.js b/lib/less/index.js
index a18b817..d23b9ee 100644
--- a/lib/less/index.js
+++ b/lib/less/index.js
@@ -20,8 +20,13 @@ var less = {
 
         if (callback) {
             parser.parse(input, function (e, root) {
-                try { callback(e, root && root.toCSS && root.toCSS(options)); } 
-                catch (err) { callback(err); }
+                if (e) { callback(e); return; }
+                var css;
+                try {
+                    css = root && root.toCSS && root.toCSS(options);
+                } 
+                catch (err) { callback(err); return; }
+                callback(null, css);
             });
         } else {
             ee = new (require('events').EventEmitter)();

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