diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-01-24 18:54:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 18:54:10 +0100 |
commit | abd96105300a7729a4d8eb69af2e81dd6307a163 (patch) | |
tree | 75b7556f876b2a2df3e22b905922dfb11572ef6d /cli/tests/unit/globals_test.ts | |
parent | 1084027d502d54ebf256c867fe85600b295d8a06 (diff) |
refactor: remove Deno.core (#16881)
This commit removes "Deno.core" namespace. It is strictly private API
that has no stability guarantees, we were supposed to remove it long time ago.
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'cli/tests/unit/globals_test.ts')
-rw-r--r-- | cli/tests/unit/globals_test.ts | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts index cf7293bba..c63b28973 100644 --- a/cli/tests/unit/globals_test.ts +++ b/cli/tests/unit/globals_test.ts @@ -71,12 +71,8 @@ Deno.test(function webAssemblyExists() { assert(typeof WebAssembly.compile === "function"); }); -declare global { - namespace Deno { - // deno-lint-ignore no-explicit-any, no-var - var core: any; - } -} +// @ts-ignore This is not publicly typed namespace, but it's there for sure. +const core = Deno[Deno.internal].core; Deno.test(function DenoNamespaceConfigurable() { const desc = Object.getOwnPropertyDescriptor(globalThis, "Deno"); @@ -86,19 +82,19 @@ Deno.test(function DenoNamespaceConfigurable() { }); Deno.test(function DenoCoreNamespaceIsImmutable() { - const { print } = Deno.core; + const { print } = core; try { - Deno.core.print = 1; + core.print = 1; } catch { // pass } - assert(print === Deno.core.print); + assert(print === core.print); try { - delete Deno.core.print; + delete core.print; } catch { // pass } - assert(print === Deno.core.print); + assert(print === core.print); }); Deno.test(async function windowQueueMicrotask() { |