parent
fccbc488ea
commit
f7f42dbd63
File diff suppressed because one or more lines are too long
|
@ -40,9 +40,11 @@ export function create(
|
|||
onError: (message: string) => void = _defaultOnError
|
||||
): IncrementalCompiler {
|
||||
|
||||
function printDiagnostic(diag: ts.Diagnostic): void {
|
||||
function printDiagnostic(diag: ts.Diagnostic | Error): void {
|
||||
|
||||
if (!diag.file || !diag.start) {
|
||||
if (diag instanceof Error) {
|
||||
onError(diag.message);
|
||||
} else if (!diag.file || !diag.start) {
|
||||
onError(ts.flattenDiagnosticMessageText(diag.messageText, '\n'));
|
||||
} else {
|
||||
const lineAndCh = diag.file.getLineAndCharacterOfPosition(diag.start);
|
||||
|
|
Loading…
Reference in New Issue