pull/11639/head
Rich Harris 2 years ago
parent 185ab80ab0
commit fca6b8cf8c

@ -1,12 +1,13 @@
/* This file is generated by scripts/process-messages/index.js. Do not edit! */
import * as state from './state.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */
// interface is duplicated between here (used internally) and ./interfaces.js
// (exposed publicly), and I'm not sure how to avoid that
export class CompileError extends Error {
name = 'CompileError';
/** @type {import('#compiler').CompileError['filename']} */
filename = undefined;
filename = state.filename;
/** @type {import('#compiler').CompileError['position']} */
position = undefined;
/** @type {import('#compiler').CompileError['start']} */
@ -24,6 +25,11 @@ export class CompileError extends Error {
super(message);
this.code = code;
this.position = position;
if (position) {
this.start = state.locator(position[0]);
this.end = state.locator(position[1]);
}
}
toString() {

Loading…
Cancel
Save