commit 1430ebaf067f7420030651774224f28602814b88 parent dd8923deca67c7584eb9c99629363423639ab9b4 Author: Emily Eisenberg <emily@khanacademy.org> Date: Mon, 22 Jul 2013 14:46:13 -0700 Make ParseErrors differentiable from other Errors Auditors: alpert Diffstat:
| M | ParseError.js | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git 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;