From c1fc7b2cd511ce83566f696c8880d6718e5c6885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 7 Dec 2023 14:21:01 +0100 Subject: refactor: pull 'core', 'internals', 'primordials' from ES module (#21462) This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file. --- ext/net/01_net.js | 3 +-- ext/net/02_tls.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'ext/net') diff --git a/ext/net/01_net.js b/ext/net/01_net.js index b4b8ca218..c81ca61c5 100644 --- a/ext/net/01_net.js +++ b/ext/net/01_net.js @@ -1,6 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -const core = globalThis.Deno.core; +import { core, primordials } from "ext:core/mod.js"; const { BadResourcePrototype, InterruptedPrototype, ops } = core; import { readableStreamForRidUnrefable, @@ -11,7 +11,6 @@ import { import * as abortSignal from "ext:deno_web/03_abort_signal.js"; import { SymbolDispose } from "ext:deno_web/00_infra.js"; -const primordials = globalThis.__bootstrap.primordials; const { Error, Number, diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 4be2f08e0..a73e3ef04 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -1,9 +1,8 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -const core = globalThis.Deno.core; +import { core, primordials } from "ext:core/mod.js"; const ops = core.ops; import { Conn, Listener } from "ext:deno_net/01_net.js"; -const primordials = globalThis.__bootstrap.primordials; const { Number, TypeError } = primordials; function opStartTls(args) { -- cgit v1.2.3