
committed by
Igor Minar

parent
83c1383701
commit
83d207d0a7
@ -172,7 +172,7 @@ export class EmittingCompilerHost implements ts.CompilerHost {
|
||||
|
||||
writeFile: ts.WriteFileCallback =
|
||||
(fileName: string, data: string, writeByteOrderMark: boolean,
|
||||
onError?: (message: string) => void, sourceFiles?: ts.SourceFile[]) => {
|
||||
onError?: (message: string) => void, sourceFiles?: ReadonlyArray<ts.SourceFile>) => {
|
||||
this.addWrittenFile(fileName, data);
|
||||
if (this.options.emitMetadata && sourceFiles && sourceFiles.length && DTS.test(fileName)) {
|
||||
const metadataFilePath = fileName.replace(DTS, '.metadata.json');
|
||||
@ -430,7 +430,7 @@ export class MockMetadataBundlerHost implements MetadataBundlerHost {
|
||||
|
||||
getMetadataFor(moduleName: string): ModuleMetadata|undefined {
|
||||
const source = this.host.getSourceFile(moduleName + '.ts', ts.ScriptTarget.Latest);
|
||||
return this.collector.getMetadata(source);
|
||||
return source && this.collector.getMetadata(source);
|
||||
}
|
||||
}
|
||||
|
||||
@ -603,7 +603,7 @@ export function expectNoDiagnostics(program: ts.Program) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function expectNoDiagnostics(diagnostics: ts.Diagnostic[]) {
|
||||
function expectNoDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>) {
|
||||
if (diagnostics && diagnostics.length) {
|
||||
throw new Error(
|
||||
'Errors from TypeScript:\n' +
|
||||
|
Reference in New Issue
Block a user