clean up code in cli/js (#6611)

This commit is contained in:
Stanislav 2020-07-07 04:45:39 +03:00 committed by GitHub
parent ab4c574f52
commit 158ae0bfe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 395 additions and 354 deletions

View file

@ -1,4 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// TODO(ry) Combine this implementation with //deno_typescript/compiler_main.js
// This module is the entry point for "compiler" isolate, ie. the one
@ -286,8 +287,7 @@ class SourceFile {
): string | undefined {
const containingCache = RESOLVED_SPECIFIER_CACHE.get(containingFile);
if (containingCache) {
const resolvedUrl = containingCache.get(moduleSpecifier);
return resolvedUrl;
return containingCache.get(moduleSpecifier);
}
return undefined;
}
@ -315,8 +315,8 @@ function getAssetInternal(filename: string): SourceFile {
class Host implements ts.CompilerHost {
protected _options = DEFAULT_COMPILE_OPTIONS;
#target: CompilerHostTarget;
#writeFile: WriteFileCallback;
readonly #target: CompilerHostTarget;
readonly #writeFile: WriteFileCallback;
/* Deno specific APIs */
constructor({
@ -519,7 +519,7 @@ class Host implements ts.CompilerHost {
}
class IncrementalCompileHost extends Host {
#buildInfo: undefined | string = undefined;
readonly #buildInfo?: string;
constructor(options: IncrementalCompilerHostOptions) {
super(options);
@ -1123,9 +1123,7 @@ function buildBundle(
target === ts.ScriptTarget.ES3 ||
target === ts.ScriptTarget.ES5 ||
target === ts.ScriptTarget.ES2015 ||
target === ts.ScriptTarget.ES2016
? true
: false;
target === ts.ScriptTarget.ES2016;
return `${
es5Bundle ? SYSTEM_LOADER_ES5 : SYSTEM_LOADER
}\n${data}\n${instantiate}`;