summaryrefslogtreecommitdiff
path: root/ext/fetch
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-12-07 14:21:01 +0100
committerGitHub <noreply@github.com>2023-12-07 14:21:01 +0100
commitc1fc7b2cd511ce83566f696c8880d6718e5c6885 (patch)
tree6430faa4996b1022c0e1ae1e78cb3b9e196029eb /ext/fetch
parent5dd9b26155ceed514364f92fe4fdacb6b8cc8182 (diff)
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.
Diffstat (limited to 'ext/fetch')
-rw-r--r--ext/fetch/20_headers.js2
-rw-r--r--ext/fetch/21_formdata.js3
-rw-r--r--ext/fetch/22_body.js3
-rw-r--r--ext/fetch/22_http_client.js2
-rw-r--r--ext/fetch/23_request.js2
-rw-r--r--ext/fetch/23_response.js3
-rw-r--r--ext/fetch/26_fetch.js3
-rw-r--r--ext/fetch/27_eventsource.js3
8 files changed, 8 insertions, 13 deletions
diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js
index d03751d08..4b95595ec 100644
--- a/ext/fetch/20_headers.js
+++ b/ext/fetch/20_headers.js
@@ -19,7 +19,7 @@ import {
HTTP_TOKEN_CODE_POINT_RE,
httpTrim,
} from "ext:deno_web/00_infra.js";
-const primordials = globalThis.__bootstrap.primordials;
+import { primordials } from "ext:core/mod.js";
const {
ArrayIsArray,
ArrayPrototypePush,
diff --git a/ext/fetch/21_formdata.js b/ext/fetch/21_formdata.js
index 12ce2bb58..0d9990fcd 100644
--- a/ext/fetch/21_formdata.js
+++ b/ext/fetch/21_formdata.js
@@ -9,7 +9,7 @@
/// <reference path="./lib.deno_fetch.d.ts" />
/// <reference lib="esnext" />
-const core = globalThis.Deno.core;
+import { core, primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import {
Blob,
@@ -17,7 +17,6 @@ import {
File,
FilePrototype,
} from "ext:deno_web/09_file.js";
-const primordials = globalThis.__bootstrap.primordials;
const {
ArrayPrototypePush,
ArrayPrototypeSlice,
diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js
index 644b9f76f..54edb7999 100644
--- a/ext/fetch/22_body.js
+++ b/ext/fetch/22_body.js
@@ -11,7 +11,7 @@
/// <reference path="./lib.deno_fetch.d.ts" />
/// <reference lib="esnext" />
-const core = globalThis.Deno.core;
+import { core, primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import {
parseUrlEncoded,
@@ -36,7 +36,6 @@ import {
readableStreamTee,
readableStreamThrowIfErrored,
} from "ext:deno_web/06_streams.js";
-const primordials = globalThis.__bootstrap.primordials;
const {
ArrayBufferPrototype,
ArrayBufferIsView,
diff --git a/ext/fetch/22_http_client.js b/ext/fetch/22_http_client.js
index 45f5de80e..25c3cba97 100644
--- a/ext/fetch/22_http_client.js
+++ b/ext/fetch/22_http_client.js
@@ -10,7 +10,7 @@
/// <reference path="./lib.deno_fetch.d.ts" />
/// <reference lib="esnext" />
-const core = globalThis.Deno.core;
+import { core } from "ext:core/mod.js";
const ops = core.ops;
import { SymbolDispose } from "ext:deno_web/00_infra.js";
diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js
index b78ed07be..512355766 100644
--- a/ext/fetch/23_request.js
+++ b/ext/fetch/23_request.js
@@ -30,7 +30,7 @@ import {
} from "ext:deno_fetch/20_headers.js";
import { HttpClientPrototype } from "ext:deno_fetch/22_http_client.js";
import * as abortSignal from "ext:deno_web/03_abort_signal.js";
-const primordials = globalThis.__bootstrap.primordials;
+import { primordials } from "ext:core/mod.js";
const {
ArrayPrototypeMap,
ArrayPrototypeSlice,
diff --git a/ext/fetch/23_response.js b/ext/fetch/23_response.js
index 0b37c1229..e5ec8fedf 100644
--- a/ext/fetch/23_response.js
+++ b/ext/fetch/23_response.js
@@ -10,7 +10,7 @@
/// <reference path="./lib.deno_fetch.d.ts" />
/// <reference lib="esnext" />
-const core = globalThis.Deno.core;
+import { core, primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
import {
@@ -30,7 +30,6 @@ import {
headerListFromHeaders,
headersFromHeaderList,
} from "ext:deno_fetch/20_headers.js";
-const primordials = globalThis.__bootstrap.primordials;
const {
ArrayPrototypeMap,
ArrayPrototypePush,
diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js
index 8a71d9bcf..b70d6d873 100644
--- a/ext/fetch/26_fetch.js
+++ b/ext/fetch/26_fetch.js
@@ -10,7 +10,7 @@
/// <reference path="./lib.deno_fetch.d.ts" />
/// <reference lib="esnext" />
-const core = globalThis.Deno.core;
+import { core, primordials } from "ext:core/mod.js";
const ops = core.ops;
import * as webidl from "ext:deno_webidl/00_webidl.js";
import { byteLowerCase } from "ext:deno_web/00_infra.js";
@@ -32,7 +32,6 @@ import {
toInnerResponse,
} from "ext:deno_fetch/23_response.js";
import * as abortSignal from "ext:deno_web/03_abort_signal.js";
-const primordials = globalThis.__bootstrap.primordials;
const {
ArrayPrototypePush,
ArrayPrototypeSplice,
diff --git a/ext/fetch/27_eventsource.js b/ext/fetch/27_eventsource.js
index 1db65d748..b8ceffb16 100644
--- a/ext/fetch/27_eventsource.js
+++ b/ext/fetch/27_eventsource.js
@@ -2,7 +2,7 @@
/// <reference path="../../core/internal.d.ts" />
-const core = globalThis.Deno.core;
+import { core, primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
@@ -19,7 +19,6 @@ import { getLocationHref } from "ext:deno_web/12_location.js";
import { newInnerRequest } from "ext:deno_fetch/23_request.js";
import { mainFetch } from "ext:deno_fetch/26_fetch.js";
-const primordials = globalThis.__bootstrap.primordials;
const {
ArrayPrototypeFind,
Number,