diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2020-04-30 17:23:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 11:23:40 -0400 |
commit | 80e22111416751ce34dbc5cb32ffa9f293517370 (patch) | |
tree | 5b3fe5d16ee07143e5dcb2c766a1f48c296ad9d6 /cli/js/compiler/host.ts | |
parent | 4993a6504b4b447e0e02454094cffb02ee18c081 (diff) |
Unstable methods should not appear in runtime or d.ts (#4957)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Diffstat (limited to 'cli/js/compiler/host.ts')
-rw-r--r-- | cli/js/compiler/host.ts | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cli/js/compiler/host.ts b/cli/js/compiler/host.ts index 70e712ffe..afe184d3e 100644 --- a/cli/js/compiler/host.ts +++ b/cli/js/compiler/host.ts @@ -14,9 +14,8 @@ export enum CompilerHostTarget { export interface CompilerHostOptions { bundle?: boolean; - target: CompilerHostTarget; - + unstable?: boolean; writeFile: WriteFileCallback; } @@ -146,13 +145,26 @@ export class Host implements ts.CompilerHost { /* Deno specific APIs */ - constructor({ bundle = false, target, writeFile }: CompilerHostOptions) { + constructor({ + bundle = false, + target, + unstable, + writeFile, + }: CompilerHostOptions) { this.#target = target; this.#writeFile = writeFile; if (bundle) { // options we need to change when we are generating a bundle Object.assign(this.#options, defaultBundlerOptions); } + if (unstable) { + this.#options.lib = [ + target === CompilerHostTarget.Worker + ? "lib.deno.worker.d.ts" + : "lib.deno.window.d.ts", + "lib.deno.unstable.d.ts", + ]; + } } configure(path: string, configurationText: string): ConfigureResponse { |