summaryrefslogtreecommitdiff
path: root/cli/js/compiler.ts
diff options
context:
space:
mode:
authorStanislav <62983943+stanislavstrelnikov@users.noreply.github.com>2020-07-07 04:45:39 +0300
committerGitHub <noreply@github.com>2020-07-06 21:45:39 -0400
commit158ae0bfe900d2bac3076390c4fe3d2b54d94fe5 (patch)
tree209e4b5682e2a899041767c49428e34329e48084 /cli/js/compiler.ts
parentab4c574f5202f607ceb6068f56b3cc8aed1bbbaf (diff)
clean up code in cli/js (#6611)
Diffstat (limited to 'cli/js/compiler.ts')
-rw-r--r--cli/js/compiler.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index 33fef4002..500716a64 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -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}`;