pegjs/lib/grammar-error.js
David Majda 5e6b5da4e9 Merge pull request #347 from mbaumgartl/errorstack
Add stack trace in engines based on V8
2015-07-03 13:05:41 +02:00

19 lines
417 B
JavaScript

"use strict";
var classes = require("./utils/classes");
/* Thrown when the grammar contains an error. */
function GrammarError(message, location) {
this.name = "GrammarError";
this.message = message;
this.location = location;
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, GrammarError);
}
}
classes.subclass(GrammarError, Error);
module.exports = GrammarError;