diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/build.rs | 6 | ||||
-rw-r--r-- | cli/dts/lib.deno.shared_globals.d.ts | 24 | ||||
-rw-r--r-- | cli/main.rs | 3 | ||||
-rw-r--r-- | cli/tests/unit/dom_iterable_test.ts | 5 | ||||
-rw-r--r-- | cli/tsc.rs | 1 |
5 files changed, 11 insertions, 28 deletions
diff --git a/cli/build.rs b/cli/build.rs index 3f97a71b7..6606242e2 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -8,6 +8,7 @@ use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_core::JsRuntime; use deno_core::RuntimeOptions; +use deno_runtime::deno_console; use deno_runtime::deno_crypto; use deno_runtime::deno_fetch; use deno_runtime::deno_url; @@ -62,6 +63,7 @@ fn create_compiler_snapshot( ) { // libs that are being provided by op crates. let mut op_crate_libs = HashMap::new(); + op_crate_libs.insert("deno.console", deno_console::get_declaration()); op_crate_libs.insert("deno.url", deno_url::get_declaration()); op_crate_libs.insert("deno.web", deno_web::get_declaration()); op_crate_libs.insert("deno.fetch", deno_fetch::get_declaration()); @@ -257,6 +259,10 @@ fn main() { println!("cargo:rustc-env=TS_VERSION={}", ts_version()); println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash()); println!( + "cargo:rustc-env=DENO_CONSOLE_LIB_PATH={}", + deno_console::get_declaration().display() + ); + println!( "cargo:rustc-env=DENO_URL_LIB_PATH={}", deno_url::get_declaration().display() ); diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts index 206cafdc3..84272caeb 100644 --- a/cli/dts/lib.deno.shared_globals.d.ts +++ b/cli/dts/lib.deno.shared_globals.d.ts @@ -5,6 +5,7 @@ /// <reference no-default-lib="true" /> /// <reference lib="esnext" /> +/// <reference lib="deno.console" /> /// <reference lib="deno.url" /> /// <reference lib="deno.web" /> /// <reference lib="deno.fetch" /> @@ -391,29 +392,6 @@ interface DOMStringList { type BufferSource = ArrayBufferView | ArrayBuffer; -declare interface Console { - assert(condition?: boolean, ...data: any[]): void; - clear(): void; - count(label?: string): void; - countReset(label?: string): void; - debug(...data: any[]): void; - dir(item?: any, options?: any): void; - dirxml(...data: any[]): void; - error(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(): void; - info(...data: any[]): void; - log(...data: any[]): void; - table(tabularData?: any, properties?: string[]): void; - time(label?: string): void; - timeEnd(label?: string): void; - timeLog(label?: string, ...data: any[]): void; - timeStamp(label?: string): void; - trace(...data: any[]): void; - warn(...data: any[]): void; -} - declare var console: Console; interface MessageEventInit<T = any> extends EventInit { diff --git a/cli/main.rs b/cli/main.rs index 8d685c6db..1931c62db 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -278,8 +278,9 @@ fn print_cache_info( pub fn get_types(unstable: bool) -> String { let mut types = format!( - "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}", + "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}", crate::tsc::DENO_NS_LIB, + crate::tsc::DENO_CONSOLE_LIB, crate::tsc::DENO_URL_LIB, crate::tsc::DENO_WEB_LIB, crate::tsc::DENO_FETCH_LIB, diff --git a/cli/tests/unit/dom_iterable_test.ts b/cli/tests/unit/dom_iterable_test.ts index 259d2d440..4e94cfdba 100644 --- a/cli/tests/unit/dom_iterable_test.ts +++ b/cli/tests/unit/dom_iterable_test.ts @@ -1,7 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -/* TODO https://github.com/denoland/deno/issues/7540 -import { unitTest, assert, assertEquals } from "./test_util.ts"; +import { assert, assertEquals, unitTest } from "./test_util.ts"; // eslint-disable-next-line @typescript-eslint/explicit-function-return-type function setup() { @@ -27,7 +26,6 @@ function setup() { }; } - unitTest(function testDomIterable(): void { const { DomIterable, Base } = setup(); @@ -88,4 +86,3 @@ unitTest(function testDomIterableScope(): void { checkScope(null, window); checkScope(undefined, window); }); -*/ diff --git a/cli/tsc.rs b/cli/tsc.rs index 6bf854650..78a472dfa 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -29,6 +29,7 @@ use std::sync::Mutex; // Declaration files pub static DENO_NS_LIB: &str = include_str!("dts/lib.deno.ns.d.ts"); +pub static DENO_CONSOLE_LIB: &str = include_str!(env!("DENO_CONSOLE_LIB_PATH")); pub static DENO_URL_LIB: &str = include_str!(env!("DENO_URL_LIB_PATH")); pub static DENO_WEB_LIB: &str = include_str!(env!("DENO_WEB_LIB_PATH")); pub static DENO_FETCH_LIB: &str = include_str!(env!("DENO_FETCH_LIB_PATH")); |