summaryrefslogtreecommitdiff
path: root/cli/js/compiler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/compiler.ts')
-rw-r--r--cli/js/compiler.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index 0d9cf83d9..76a0f7262 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -6,6 +6,7 @@ import "./globals.ts";
import "./ts_global.d.ts";
import { TranspileOnlyResult } from "./compiler_api.ts";
+import { oldProgram } from "./compiler_bootstrap.ts";
import { setRootExports } from "./compiler_bundler.ts";
import {
defaultBundlerOptions,
@@ -73,7 +74,7 @@ interface CompileResult {
// bootstrap the runtime environment, this gets called as the isolate is setup
self.denoMain = function denoMain(compilerType?: string): void {
- os.start(true, compilerType || "TS");
+ os.start(true, compilerType ?? "TS");
};
// bootstrap the worker environment, this gets called as the isolate is setup
@@ -135,7 +136,12 @@ self.compilerMain = function compilerMain(): void {
// to generate the program and possibly emit it.
if (!diagnostics || (diagnostics && diagnostics.length === 0)) {
const options = host.getCompilationSettings();
- const program = ts.createProgram(rootNames, options, host);
+ const program = ts.createProgram({
+ rootNames,
+ options,
+ host,
+ oldProgram
+ });
diagnostics = ts
.getPreEmitDiagnostics(program)
@@ -213,11 +219,12 @@ self.compilerMain = function compilerMain(): void {
}
host.mergeOptions(...compilerOptions);
- const program = ts.createProgram(
+ const program = ts.createProgram({
rootNames,
- host.getCompilationSettings(),
- host
- );
+ options: host.getCompilationSettings(),
+ host,
+ oldProgram
+ });
if (bundle) {
setRootExports(program, rootNames[0]);