Files
test-repo/src/parser-create-error.js
T

12 lines
288 B
JavaScript
Raw Normal View History

2017-05-28 21:06:09 -07:00
"use strict";
2017-06-02 23:11:05 +02:00
function createError(message, loc) {
2017-05-28 21:06:09 -07:00
// Construct an error similar to the ones thrown by Babylon.
2017-06-02 23:11:05 +02:00
const error = new SyntaxError(
message + " (" + loc.start.line + ":" + loc.start.column + ")"
);
error.loc = loc;
2017-05-28 21:06:09 -07:00
return error;
}
module.exports = createError;