2017-05-29 07:06:09 +03:00
|
|
|
"use strict";
|
|
|
|
|
2017-06-03 00:11:05 +03:00
|
|
|
function createError(message, loc) {
|
2018-12-27 16:05:19 +03:00
|
|
|
// Construct an error similar to the ones thrown by Babel.
|
2017-06-03 00:11:05 +03:00
|
|
|
const error = new SyntaxError(
|
|
|
|
message + " (" + loc.start.line + ":" + loc.start.column + ")"
|
|
|
|
);
|
|
|
|
error.loc = loc;
|
2017-05-29 07:06:09 +03:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = createError;
|