[Pkg-javascript-commits] [node-syntax-error] 07/47: Do inheritance properly

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:29:58 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 242d126334d9eafad6c8887c76df12fb1b3bd8cb
Author: Forbes Lindesay <forbes at lindesay.co.uk>
Date:   Mon Apr 22 16:10:21 2013 +0200

    Do inheritance properly
    
    Otherwise the stack gets set to weird things and it doesn't work properly when you throw it, or when express logs it.
---
 index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 030d6f2..7e01c59 100644
--- a/index.js
+++ b/index.js
@@ -43,7 +43,7 @@ function ParseError (err, src, file) {
     ;
 }
 
-ParseError.prototype = new SyntaxError;
+ParseError.prototype = Object.create(SyntaxError.prototype);
 
 ParseError.prototype.toString = function () {
     return this.annotated;

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