From 837c870ff4eef49a6d03071d0a3547ab67bc91f7 Mon Sep 17 00:00:00 2001 From: Gasman <90539473+MarybethGasman@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:51:14 +0800 Subject: fix(node/http): socket.setTimeout (#20930) Fixes #20923 --- ext/node/polyfills/http.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index ae670d5f0..78bd7cb07 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -8,6 +8,7 @@ const core = globalThis.__bootstrap.core; import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; import { type Deferred, deferred } from "ext:deno_node/_util/async.ts"; +import { setTimeout } from "ext:deno_web/02_timers.js"; import { _normalizeArgs, // createConnection, @@ -289,6 +290,10 @@ class FakeSocket extends EventEmitter { end() {} destroy() {} + + setTimeout(callback, timeout = 0, ...args) { + setTimeout(callback, timeout, args); + } } /** ClientRequest represents the http(s) request from the client */ -- cgit v1.2.3