summaryrefslogtreecommitdiff
path: root/js/compiler.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-08-30 11:11:33 -0400
committerGitHub <noreply@github.com>2019-08-30 11:11:33 -0400
commitc370f749b2260cc1d8970b1dcdc63ff00008e26d (patch)
tree1eff43e71ca0a5ccaeb48a3bf891bf2fdc0712ba /js/compiler.ts
parent5401cb76304ae8d3e8896f6020ba4ef25bac0bba (diff)
Remove ts_library_builder, maintain lib.deno_runtime.d.ts by hand (#2827)
Diffstat (limited to 'js/compiler.ts')
-rw-r--r--js/compiler.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/compiler.ts b/js/compiler.ts
index e10dc50db..71b1b06c9 100644
--- a/js/compiler.ts
+++ b/js/compiler.ts
@@ -1,6 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import * as ts from "typescript";
-import { assetSourceCode } from "./assets";
import { bold, cyan, yellow } from "./colors";
import { Console } from "./console";
import { core } from "./core";
@@ -128,6 +127,10 @@ interface EmitResult {
diagnostics?: Diagnostic;
}
+function fetchAsset(name: string): string {
+ return sendSync(dispatch.OP_FETCH_ASSET, { name });
+}
+
/** Ops to Rust to resolve and fetch a modules meta data. */
function fetchSourceFile(specifier: string, referrer: string): SourceFile {
util.log("compiler.fetchSourceFile", { specifier, referrer });
@@ -222,8 +225,7 @@ class Host implements ts.CompilerHost {
const assetName = moduleName.includes(".")
? moduleName
: `${moduleName}.d.ts`;
- assert(assetName in assetSourceCode, `No such asset "${assetName}"`);
- const sourceCode = assetSourceCode[assetName];
+ const sourceCode = fetchAsset(assetName);
const sourceFile = {
moduleName,
filename: specifier,