From 1430ebaf067f7420030651774224f28602814b88 Mon Sep 17 00:00:00 2001 From: Emily Eisenberg Date: Mon, 22 Jul 2013 14:46:13 -0700 Subject: [PATCH] Make ParseErrors differentiable from other Errors Auditors: alpert --- ParseError.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ParseError.js b/ParseError.js index 602597610..6a561f478 100644 --- a/ParseError.js +++ b/ParseError.js @@ -1,7 +1,10 @@ function ParseError(message) { - this.message = "TeX parse error: " + message; + var self = new Error("TeX parse error: " + message); + self.name = "ParseError"; + self.__proto__ = ParseError.prototype; + return self; } -ParseError.prototype = Error.prototype; +ParseError.prototype.__proto__ = Error.prototype; module.exports = ParseError;