prettier/src/common/parser-create-error.js

13 lines
286 B
JavaScript

"use strict";
function createError(message, loc) {
// Construct an error similar to the ones thrown by Babel.
const error = new SyntaxError(
message + " (" + loc.start.line + ":" + loc.start.column + ")"
);
error.loc = loc;
return error;
}
module.exports = createError;