From abd96105300a7729a4d8eb69af2e81dd6307a163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 24 Jan 2023 18:54:10 +0100 Subject: 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 --- cli/bench/http/deno_http_flash_ops.js | 10 ++++------ cli/bench/http/deno_http_ops.js | 11 +++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'cli/bench/http') diff --git a/cli/bench/http/deno_http_flash_ops.js b/cli/bench/http/deno_http_flash_ops.js index 1ef2f65ed..7b024f9af 100644 --- a/cli/bench/http/deno_http_flash_ops.js +++ b/cli/bench/http/deno_http_flash_ops.js @@ -3,12 +3,10 @@ // deno-lint-ignore-file const { - core: { - opAsync, - ops: { op_flash_make_request, op_flash_serve }, - encode, - }, -} = Deno; + opAsync, + ops: { op_flash_make_request, op_flash_serve }, + encode, +} = Deno[Deno.internal].core; const addr = Deno.args[0] || "127.0.0.1:4500"; const [hostname, port] = addr.split(":"); const serverId = op_flash_serve({ hostname, port, reuseport: true }); diff --git a/cli/bench/http/deno_http_ops.js b/cli/bench/http/deno_http_ops.js index 3fd0bef31..216a47905 100644 --- a/cli/bench/http/deno_http_ops.js +++ b/cli/bench/http/deno_http_ops.js @@ -13,7 +13,10 @@ class Http { [Symbol.asyncIterator]() { return { next: async () => { - const reqEvt = await Deno.core.opAsync("op_http_accept", this.id); + const reqEvt = await Deno[Deno.internal].core.opAsync( + "op_http_accept", + this.id, + ); return { value: reqEvt ?? undefined, done: reqEvt === null }; }, }; @@ -21,20 +24,20 @@ class Http { } for await (const conn of tcp) { - const id = Deno.core.ops.op_http_start(conn.rid); + const id = Deno[Deno.internal].core.ops.op_http_start(conn.rid); const http = new Http(id); (async () => { for await (const req of http) { if (req == null) continue; const { 0: stream } = req; - await Deno.core.opAsync( + await Deno[Deno.internal].core.opAsync( "op_http_write_headers", stream, 200, [], "Hello World", ); - Deno.core.close(stream); + Deno[Deno.internal].core.close(stream); } })(); } -- cgit v1.2.3