mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
https: server add asyncDispose
PR-URL: https://github.com/nodejs/node/pull/48548 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
@@ -33,11 +33,13 @@ const {
|
||||
ObjectSetPrototypeOf,
|
||||
ReflectApply,
|
||||
ReflectConstruct,
|
||||
SymbolAsyncDispose,
|
||||
} = primordials;
|
||||
|
||||
const {
|
||||
assertCrypto,
|
||||
kEmptyObject,
|
||||
promisify,
|
||||
} = require('internal/util');
|
||||
assertCrypto();
|
||||
|
||||
@@ -110,6 +112,10 @@ Server.prototype.close = function() {
|
||||
ReflectApply(tls.Server.prototype.close, this, arguments);
|
||||
};
|
||||
|
||||
Server.prototype[SymbolAsyncDispose] = async function() {
|
||||
return FunctionPrototypeCall(promisify(this.close), this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new `https.Server` instance.
|
||||
* @param {{
|
||||
|
||||
Reference in New Issue
Block a user