Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/util/SyntaxError.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @param {int} col The column at which the error occurred.
*/
function SyntaxError(message, line, col){
Error.call(this);
this.name = this.constructor.name;

/**
* The column at which the error occurred.
Expand All @@ -33,4 +35,5 @@ function SyntaxError(message, line, col){
}

//inherit from Error
SyntaxError.prototype = new Error();
SyntaxError.prototype = Object.create(Error.prototype); // jshint ignore:line
SyntaxError.prototype.constructor = SyntaxError; // jshint ignore:line