1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00

refactor: set removal version for Deno.Server (#22024)

This change sets the removal version for the deprecated `Deno.Server`
interface for Deno 2.0.

Towards #22021
This commit is contained in:
Asher Gomez 2024-01-23 12:19:49 +11:00 committed by GitHub
parent f2b0424df6
commit 6059731594
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -3815,7 +3815,7 @@ async function curlRequestWithStdErr(args: string[]) {
return [new TextDecoder().decode(stdout), new TextDecoder().decode(stderr)]; return [new TextDecoder().decode(stdout), new TextDecoder().decode(stderr)];
} }
Deno.test("Deno.Server is not thenable", async () => { Deno.test("Deno.HttpServer is not thenable", async () => {
// deno-lint-ignore require-await // deno-lint-ignore require-await
async function serveTest() { async function serveTest() {
const server = Deno.serve({ port: servePort }, (_) => new Response("")); const server = Deno.serve({ port: servePort }, (_) => new Response(""));

View file

@ -6043,7 +6043,9 @@ declare namespace Deno {
/** /**
* @category HTTP Server * @category HTTP Server
* @deprecated Use {@linkcode HttpServer} instead. *
* @deprecated Use {@linkcode Deno.HttpServer} instead.
* {@linkcode Deno.Server} will be removed in Deno 2.0.
*/ */
export type Server = HttpServer; export type Server = HttpServer;

View file

@ -1575,7 +1575,7 @@ export class ServerImpl extends EventEmitter {
#addr: Deno.NetAddr; #addr: Deno.NetAddr;
#hasClosed = false; #hasClosed = false;
#server: Deno.Server; #server: Deno.HttpServer;
#unref = false; #unref = false;
#ac?: AbortController; #ac?: AbortController;
#serveDeferred: ReturnType<typeof Promise.withResolvers<void>>; #serveDeferred: ReturnType<typeof Promise.withResolvers<void>>;