Replace classes.subclass with native classes

See #442.
redux
David Majda 8 years ago
parent 6fa8ad63f9
commit 5822596ab8

@ -1,18 +1,16 @@
"use strict";
let classes = require("./utils/classes");
/* Thrown when the grammar contains an error. */
function GrammarError(message, location) {
this.name = "GrammarError";
this.message = message;
this.location = location;
class GrammarError {
constructor(message, location) {
this.name = "GrammarError";
this.message = message;
this.location = location;
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, GrammarError);
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, GrammarError);
}
}
}
classes.subclass(GrammarError, Error);
module.exports = GrammarError;

@ -1,12 +0,0 @@
"use strict";
/* Class utilities */
let classes = {
subclass: function(child, parent) {
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor();
}
};
module.exports = classes;

@ -37,7 +37,6 @@
"lib/parser.js",
"lib/peg.js",
"lib/utils/arrays.js",
"lib/utils/classes.js",
"lib/utils/objects.js",
"package.json"
],

Loading…
Cancel
Save