diff options
author | Ry Dahl <ry@tinyclouds.org> | 2020-01-21 14:57:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 14:57:56 -0500 |
commit | fa7f34eb8cec07f4c68ca4e9c46a983bc3e2308f (patch) | |
tree | 821263579dd75de3c16508fdecfdcaba52987373 /cli/js/compiler_host.ts | |
parent | 7fd50065a7d8a4c6ed1b1090703a7baaabdbd6aa (diff) |
Revert "Create an old program to be used in snapshot. (#3644)"
Ref #3712. This change allowed the deno_typescript crate to reference
cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to
reintroduce a revised version of this patch later once "cargo
package" is working and tested.
This reverts commit 737ab94ea1bdf65eeef323ea37e84bcf430fb92c.
Diffstat (limited to 'cli/js/compiler_host.ts')
-rw-r--r-- | cli/js/compiler_host.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/js/compiler_host.ts b/cli/js/compiler_host.ts index 3e6df4485..f8921a352 100644 --- a/cli/js/compiler_host.ts +++ b/cli/js/compiler_host.ts @@ -18,7 +18,7 @@ export interface ConfigureResponse { diagnostics?: ts.Diagnostic[]; } -export const ASSETS = "$asset$"; +const ASSETS = "$asset$"; /** Options that need to be used when generating a bundle (either trusted or * runtime). */ @@ -129,11 +129,11 @@ export class Host implements ts.CompilerHost { private _writeFile: WriteFileCallback; private _getAsset(filename: string): SourceFile { - const url = filename.split("/").pop()!; - const sourceFile = SourceFile.get(url); + const sourceFile = SourceFile.get(filename); if (sourceFile) { return sourceFile; } + const url = filename.split("/").pop()!; const name = url.includes(".") ? url : `${url}.d.ts`; const sourceCode = sendSync(dispatch.OP_FETCH_ASSET, { name }); return new SourceFile({ @@ -238,15 +238,13 @@ export class Host implements ts.CompilerHost { : SourceFile.get(fileName); assert(sourceFile != null); if (!sourceFile.tsSourceFile) { - assert(sourceFile.sourceCode != null); sourceFile.tsSourceFile = ts.createSourceFile( fileName, sourceFile.sourceCode, languageVersion ); - delete sourceFile.sourceCode; } - return sourceFile.tsSourceFile; + return sourceFile!.tsSourceFile; } catch (e) { if (onError) { onError(String(e)); |