diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-01-11 07:37:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 15:37:25 -0700 |
commit | 515a34b4de222e35c7ade1b92614d746e73d4c2e (patch) | |
tree | 8284201fc826a33f12597959a8a8be14e0f524bd /ext/http/00_serve.js | |
parent | d4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff) |
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/http/00_serve.js')
-rw-r--r-- | ext/http/00_serve.js | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index 131f056a7..1bdcbd5d3 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -1,8 +1,43 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals, primordials } from "ext:core/mod.js"; +const { + BadResourcePrototype, + InterruptedPrototype, +} = core; +const { + op_http_close_after_finish, + op_http_get_request_headers, + op_http_get_request_method_and_url, + op_http_read_request_body, + op_http_serve, + op_http_serve_on, + op_http_set_promise_complete, + op_http_set_response_body_bytes, + op_http_set_response_body_resource, + op_http_set_response_body_text, + op_http_set_response_header, + op_http_set_response_headers, + op_http_set_response_trailers, + op_http_upgrade_raw, + op_http_upgrade_websocket_next, + op_http_try_wait, + op_http_wait, + op_http_cancel, + op_http_close, +} = core.ensureFastOps(); +const { + ArrayPrototypePush, + ObjectHasOwn, + ObjectPrototypeIsPrototypeOf, + PromisePrototypeCatch, + PromisePrototypeThen, + Symbol, + TypeError, + TypedArrayPrototypeGetSymbolToStringTag, + Uint8Array, +} = primordials; -const { BadResourcePrototype, InterruptedPrototype } = core; import { InnerBody } from "ext:deno_fetch/22_body.js"; import { Event } from "ext:deno_web/02_event.js"; import { @@ -36,39 +71,7 @@ import { import { listen, listenOptionApiName, TcpConn } from "ext:deno_net/01_net.js"; import { listenTls } from "ext:deno_net/02_tls.js"; import { SymbolAsyncDispose } from "ext:deno_web/00_infra.js"; -const { - ArrayPrototypePush, - ObjectHasOwn, - ObjectPrototypeIsPrototypeOf, - PromisePrototypeCatch, - PromisePrototypeThen, - Symbol, - TypeError, - TypedArrayPrototypeGetSymbolToStringTag, - Uint8Array, -} = primordials; -const { - op_http_close_after_finish, - op_http_get_request_headers, - op_http_get_request_method_and_url, - op_http_read_request_body, - op_http_serve, - op_http_serve_on, - op_http_set_promise_complete, - op_http_set_response_body_bytes, - op_http_set_response_body_resource, - op_http_set_response_body_text, - op_http_set_response_header, - op_http_set_response_headers, - op_http_set_response_trailers, - op_http_upgrade_raw, - op_http_upgrade_websocket_next, - op_http_try_wait, - op_http_wait, - op_http_cancel, - op_http_close, -} = core.ensureFastOps(); const _upgraded = Symbol("_upgraded"); function internalServerError() { |