[Pkg-javascript-commits] [node-syntax-error] 38/47: return error, don't throw

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:30:02 UTC 2017


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

rouca pushed a commit to branch master
in repository node-syntax-error.

commit 06917a258da1752bdbbc7eaaa47104f160a0502f
Author: James Halliday <mail at substack.net>
Date:   Wed Mar 30 19:18:42 2016 -0700

    return error, don't throw
---
 index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 0bdee87..9048d77 100644
--- a/index.js
+++ b/index.js
@@ -15,7 +15,7 @@ module.exports = function (src, file) {
     }
     catch (err) {
         if (err === 'STOP') return undefined;
-        if (err.constructor.name !== 'SyntaxError') throw err;
+        if (err.constructor.name !== 'SyntaxError') return err;
         return errorInfo(src, file);
     }
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-syntax-error.git



More information about the Pkg-javascript-commits mailing list