diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-05-01 17:40:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 17:40:00 +0200 |
commit | dcf391ffed3850f9026d88b146e156375c4619d4 (patch) | |
tree | 2134755e8abbecaba1d42703fe727ae701ee390c /ext/http/01_http.js | |
parent | 6728ad4203d731e555dabf89ec6157f113454ce6 (diff) |
refactor: migrate async ops to generated wrappers (#18937)
Migrates some of existing async ops to generated wrappers introduced in
https://github.com/denoland/deno/pull/18887. As a result "core.opAsync2"
was removed.
I will follow up with more PRs that migrate all the async ops to
generated wrappers.
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r-- | ext/http/01_http.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js index f41a2beed..92fd8e285 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -1,8 +1,12 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +// deno-lint-ignore-file camelcase + const core = globalThis.Deno.core; const internals = globalThis.__bootstrap.internals; const primordials = globalThis.__bootstrap.primordials; const { BadResourcePrototype, InterruptedPrototype, ops } = core; +const { op_http_write } = Deno.core.generateAsyncOpHandler("op_http_write"); import * as webidl from "ext:deno_webidl/00_webidl.js"; import { InnerBody } from "ext:deno_fetch/22_body.js"; import { Event, setEventTargetData } from "ext:deno_web/02_event.js"; @@ -321,7 +325,7 @@ function createRespondWith( break; } try { - await core.opAsync2("op_http_write", streamRid, value); + await op_http_write(streamRid, value); } catch (error) { const connError = httpConn[connErrorSymbol]; if ( |