diff --git a/lib/jison.js b/lib/jison.js index 1af81fb9b..3b01410d0 100755 --- a/lib/jison.js +++ b/lib/jison.js @@ -1359,7 +1359,13 @@ function parseError (str, hash) { if (hash.recoverable) { this.trace(str); } else { - throw new Error(str); + function _parseError (msg, hash) { + this.message = msg; + this.hash = hash; + } + _parseError.prototype = new Error(); + + throw new _parseError(str, hash); } }