From ae81065c758a540aa61639e51372c1e254d92c9a Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 9 Oct 2023 12:43:14 +0900 Subject: fix(ext/http): Deno.Server should not be thenable (#20723) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise you can not return `Deno.Server` from async functions. Co-authored-by: Yoshiya Hinosawa Co-authored-by: Bartek IwaƄczuk --- ext/http/00_serve.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'ext/http/00_serve.js') diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index e74e1e71f..2e0c62fef 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -38,7 +38,6 @@ import { listen, listenOptionApiName, TcpConn } from "ext:deno_net/01_net.js"; import { listenTls } from "ext:deno_net/02_tls.js"; const { ArrayPrototypePush, - Error, ObjectHasOwn, ObjectPrototypeIsPrototypeOf, PromisePrototypeCatch, @@ -700,11 +699,6 @@ function serveHttpOn(context, callback) { context.closed = true; } }, - then() { - throw new Error( - "Deno.serve no longer returns a promise. await server.finished instead of server.", - ); - }, ref() { ref = true; if (currentPromise) { -- cgit v1.2.3