Skip to content

Commit

Permalink
_parseError should be an instance of Error.
Browse files Browse the repository at this point in the history
Fixes a regression introduced by #319
while still providing a fix for #318.
  • Loading branch information
RubenVerborgh committed Apr 2, 2016
1 parent 6ecb980 commit 3367ad1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/jison.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 3367ad1

Please sign in to comment.