diff options
Diffstat (limited to 'cli/tests/testdata/error_for_await.ts')
-rw-r--r-- | cli/tests/testdata/error_for_await.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/testdata/error_for_await.ts b/cli/tests/testdata/error_for_await.ts new file mode 100644 index 000000000..6e8c5203f --- /dev/null +++ b/cli/tests/testdata/error_for_await.ts @@ -0,0 +1,14 @@ +const listener = Deno.listen({ port: 8080 }); + +for await (const conn of listener) { + handleConn(conn); +} + +function handleConn(conn: Deno.Conn) { + const httpConn = Deno.serveHttp(conn); + for await (const event of httpConn) { + event.respondWith(new Response("html", { status: 200 })); + } +} + +export {}; |