Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed May 9, 2020
1 parent f0aff08 commit 03580ce
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions cli/js/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ async function processImports(
return resolvedSources;
}

function buildSourceFileCache(sourceFileMap: Record<string, SourceFileMapEntry>): void {
function buildSourceFileCache(
sourceFileMap: Record<string, SourceFileMapEntry>
): void {
for (const entry of Object.values(sourceFileMap)) {
assert(entry.sourceCode.length > 0);
SourceFile.addToCache({
Expand Down Expand Up @@ -786,24 +788,20 @@ function buildSourceFileCache(sourceFileMap: Record<string, SourceFileMapEntry>)
}
}

SourceFile.cacheResolvedUrl(
mappedUrl,
importDesc.specifier,
entry.url,
);
SourceFile.cacheResolvedUrl(mappedUrl, importDesc.specifier, entry.url);
}
for (const fileRef of entry.referencedFiles) {
SourceFile.cacheResolvedUrl(
fileRef.resolvedSpecifier,
fileRef.specifier,
entry.url,
entry.url
);
}
for (const fileRef of entry.libDirectives) {
SourceFile.cacheResolvedUrl(
fileRef.resolvedSpecifier,
fileRef.specifier,
entry.url,
entry.url
);
}
}
Expand Down Expand Up @@ -1293,11 +1291,11 @@ interface SourceFileMapEntry {
url: string;
sourceCode: string;
mediaType: MediaType;
imports: ImportDescriptor[],
referencedFiles: ReferenceDescriptor[],
libDirectives: ReferenceDescriptor[],
typesDirectives: ReferenceDescriptor[],
typeHeaders: ReferenceDescriptor[],
imports: ImportDescriptor[];
referencedFiles: ReferenceDescriptor[];
libDirectives: ReferenceDescriptor[];
typesDirectives: ReferenceDescriptor[];
typeHeaders: ReferenceDescriptor[];
}

interface CompilerRequestCompileNew {
Expand Down Expand Up @@ -1351,7 +1349,7 @@ interface RuntimeBundleResult {
diagnostics: DiagnosticItem[];
}

async function compileNew(
function compileNew(
request: CompilerRequestCompileNew
): Promise<CompileResult> {
const {
Expand Down Expand Up @@ -1453,7 +1451,6 @@ async function compileNew(
return result;
}


async function compile(
request: CompilerRequestCompile
): Promise<CompileResult> {
Expand Down Expand Up @@ -1745,7 +1742,7 @@ async function tsCompilerOnMessage({
break;
}
case CompilerRequestType.CompileNew: {
const result = await compileNew(request as CompilerRequestCompileNew);
const result = compileNew(request as CompilerRequestCompileNew);
globalThis.postMessage(result);
break;
}
Expand Down

0 comments on commit 03580ce

Please sign in to comment.