mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
13 lines
409 B
JavaScript
13 lines
409 B
JavaScript
export class CompileError {}
|
|
|
|
export function throwCompileError(tag, message, overrideIndex) {
|
|
const finalIndex = (typeof overrideIndex === 'number' ?
|
|
overrideIndex : tag.tagStartIndex);
|
|
|
|
const err = new CompileError();
|
|
err.message = message || "bad formatting in template file";
|
|
err.file = tag.sourceName;
|
|
err.line = tag.fileContents.substring(0, finalIndex).split('\n').length;
|
|
throw err;
|
|
}
|