diff --git a/build/lib/tsb/index.js b/build/lib/tsb/index.js index eb5a7de7489..22014c9d696 100644 --- a/build/lib/tsb/index.js +++ b/build/lib/tsb/index.js @@ -28,7 +28,10 @@ function createNullCompiler() { const _defaultOnError = (err) => console.log(JSON.stringify(err, null, 4)); function create(projectPath, existingOptions, config, onError = _defaultOnError) { function printDiagnostic(diag) { - 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 { @@ -130,4 +133,4 @@ function create(projectPath, existingOptions, config, onError = _defaultOnError) return result; } exports.create = create; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7OztnR0FHZ0c7OztBQUVoRywrQkFBK0I7QUFDL0IsbUNBQW1DO0FBQ25DLHFDQUFxQztBQUNyQyxpQ0FBaUM7QUFDakMsbUNBQW9EO0FBQ3BELCtCQUErQjtBQUMvQixtQ0FBa0M7QUFDbEMsMkJBQTRDO0FBQzVDLGlDQUFpQztBQUNqQyxzQ0FBdUM7QUFDdkMsNkNBQXlFO0FBT3pFLE1BQU0sV0FBWSxTQUFRLGVBQU07SUFDL0IsTUFBTSxDQUFDLE1BQVcsRUFBRSxTQUFpQixFQUFFLFFBQStCLElBQVUsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBQzdGLEtBQUssS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUM1QjtBQUVELFNBQVMsa0JBQWtCO0lBQzFCLE1BQU0sTUFBTSxHQUF3QixjQUFjLE9BQU8sSUFBSSxXQUFXLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUM5RSxNQUFNLENBQUMsR0FB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yxDQUFDLENBQUM7UUFDOUMsT0FBTyxJQUFJLEtBQU0sU0FBUSxpQkFBUTtZQUNoQztnQkFDQyxLQUFLLENBQUMsRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztZQUM3QixDQUFDO1lBQ0QsS0FBSztnQkFDSixJQUFJLElBQUksR0FBWSxJQUFJLENBQUM7Z0JBQ3pCLElBQUksSUFBWSxDQUFDO2dCQUNqQixPQUFPLElBQUksSUFBSSxJQUFJLEdBQUcsVUFBVSxDQUFDLE1BQU0sRUFBRSxJQUFJLEVBQUUsRUFBRTtvQkFDaEQsSUFBSSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQztvQkFDeEIsSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxLQUFLLENBQUM7d0JBQzFCLElBQUk7d0JBQ0osUUFBUSxFQUFFLElBQUEsaUJBQVksRUFBQyxJQUFJLENBQUM7d0JBQzVCLElBQUksRUFBRSxJQUFBLGFBQVEsRUFBQyxJQUFJLENBQUM7d0JBQ3BCLEdBQUcsRUFBRSxJQUFJLElBQUksSUFBSSxDQUFDLEdBQUc7d0JBQ3JCLElBQUksRUFBRSxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksSUFBSSxJQUFBLGNBQU8sRUFBQyxXQUFXLENBQUM7cUJBQy9DLENBQUMsQ0FBQyxDQUFDO2lCQUNKO2dCQUNELElBQUksSUFBSSxJQUFJLFVBQVUsQ0FBQyxNQUFNLEVBQUU7b0JBQzlCLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7aUJBQ2hCO1lBQ0YsQ0FBQztTQUNELENBQUM7SUFDSCxDQUFDLENBQUM7SUFFRixPQUE0QixNQUFNLENBQUM7QUFDcEMsQ0FBQztBQXBJRCx3QkFvSUMifQ== \ No newline at end of file diff --git a/build/lib/tsb/index.ts b/build/lib/tsb/index.ts index 0c5952cec34..670ac6542e7 100644 --- a/build/lib/tsb/index.ts +++ b/build/lib/tsb/index.ts @@ -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);