diff --git a/lib/runtime.js b/lib/runtime.js index 592d42e..058b766 100644 --- a/lib/runtime.js +++ b/lib/runtime.js @@ -181,9 +181,9 @@ PEG.Parser.prototype = { if (result === null || this._pos !== input.length) { var errorPosition = computeErrorPosition(); throw new PEG.Parser.SyntaxError( + buildErrorMessage(), errorPosition.line, - errorPosition.column, - buildErrorMessage() + errorPosition.column ); } @@ -230,11 +230,11 @@ PEG.Parser.NamedRuleMatchFailure.prototype = { /* Thrown when a parser encounters a syntax error. */ -PEG.Parser.SyntaxError = function(line, column, message) { +PEG.Parser.SyntaxError = function(message, line, column) { this.name = "PEG.Parser.SyntaxError"; + this.message = message; this.line = line; this.column = column; - this.message = message; }; PEG.Parser.SyntaxError.prototype = Error.prototype;