From 3367ad1ca2a55eafaf5b1caf6a1658a3c375bae7 Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Sat, 2 Apr 2016 19:30:14 +0200 Subject: [PATCH] _parseError should be an instance of Error. Fixes a regression introduced by #319 while still providing a fix for #318. --- lib/jison.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/jison.js b/lib/jison.js index b47f80a49..d078056ee 100755 --- a/lib/jison.js +++ b/lib/jison.js @@ -1359,13 +1359,9 @@ function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { - function _parseError (msg, hash) { - this.message = msg; - this.hash = hash; - } - _parseError.prototype = Error; - - throw new _parseError(str, hash); + var error = new Error(str); + error.hash = hash; + throw error; } }