diff --git a/lib/_http_server.js b/lib/_http_server.js index 67c28e2d3a2d1f..0242e7a089dd6f 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -24,6 +24,7 @@ const { ArrayIsArray, Error, + FunctionPrototypeCall, MathMin, ObjectKeys, ObjectSetPrototypeOf, @@ -560,7 +561,7 @@ Server.prototype.close = function() { }; Server.prototype[SymbolAsyncDispose] = async function() { - return promisify(this.close).call(this); + return FunctionPrototypeCall(promisify(this.close), this); }; Server.prototype.closeAllConnections = function() { diff --git a/lib/https.js b/lib/https.js index e3acde5ab663bb..d8b42c85493f7e 100644 --- a/lib/https.js +++ b/lib/https.js @@ -113,7 +113,7 @@ Server.prototype.close = function() { }; Server.prototype[SymbolAsyncDispose] = async function() { - return promisify(this.close).call(this); + return FunctionPrototypeCall(promisify(this.close), this); }; /** diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 7fce6a21585648..fe104f52a38ed8 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -3192,7 +3192,7 @@ class Http2Server extends NETServer { } async [SymbolAsyncDispose]() { - return promisify(super.close).call(this); + return FunctionPrototypeCall(promisify(super.close), this); } }