From 357bcfcf79fee92195e37bb3f05e247908f207c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 27 Mar 2023 16:25:17 +0200 Subject: =?UTF-8?q?Revert=20"refactor:=20remove=20Deno[Deno.internal].node?= =?UTF-8?q?Unstable=20namespace=20(=E2=80=A6=20(#18458)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …#18449)" This reverts commit d1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d. Appears this made CI very flaky on macOS, but I can't repeat it locally yet --- ext/node/polyfills/http.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/node/polyfills/http.ts') diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index b99e7afab..87b19972f 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1,7 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -const core = globalThis.Deno.core; -const ops = core.ops; import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; import { type Deferred, deferred } from "ext:deno_node/_util/async.ts"; import { _normalizeArgs, ListenOptions, Socket } from "ext:deno_node/net.ts"; @@ -19,7 +17,6 @@ import { Agent } from "ext:deno_node/_http_agent.mjs"; import { chunkExpression as RE_TE_CHUNKED } from "ext:deno_node/_http_common.ts"; import { urlToHttpOptions } from "ext:deno_node/internal/url.ts"; import { constants, TCP } from "ext:deno_node/internal_binding/tcp_wrap.ts"; -import * as flash from "ext:deno_flash/01_http.js"; enum STATUS_CODES { /** RFC 7231, 6.2.1 */ @@ -191,8 +188,11 @@ const METHODS = [ type Chunk = string | Buffer | Uint8Array; -const DenoServe = flash.createServe(ops.op_node_unstable_flash_serve); -const DenoUpgradeHttpRaw = flash.upgradeHttpRaw; +// @ts-ignore Deno[Deno.internal] is used on purpose here +const DenoServe = Deno[Deno.internal]?.nodeUnstable?.serve || Deno.serve; +// @ts-ignore Deno[Deno.internal] is used on purpose here +const DenoUpgradeHttpRaw = Deno[Deno.internal]?.nodeUnstable?.upgradeHttpRaw || + Deno.upgradeHttpRaw; const ENCODER = new TextEncoder(); -- cgit v1.2.3