diff options
Diffstat (limited to 'tests/testdata/run/error_for_await.ts')
-rw-r--r-- | tests/testdata/run/error_for_await.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/testdata/run/error_for_await.ts b/tests/testdata/run/error_for_await.ts new file mode 100644 index 000000000..64c81abe4 --- /dev/null +++ b/tests/testdata/run/error_for_await.ts @@ -0,0 +1,12 @@ +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 })); + } +} |