diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js index f895a46c1a037e..da6e66f2b6503d 100644 --- a/lib/internal/dns/utils.js +++ b/lib/internal/dns/utils.js @@ -34,6 +34,8 @@ const { ERR_INVALID_ARG_VALUE, ERR_INVALID_IP_ADDRESS, } = errors.codes; +function NullObject() {} +NullObject.prototype = ObjectCreate(null); function validateTimeout(options) { const { timeout = -1 } = { ...options }; @@ -221,7 +223,7 @@ function setDefaultResultOrder(value) { } function createResolverClass(resolver) { - const resolveMap = ObjectCreate(null); + const resolveMap = new NullObject(); class Resolver extends ResolverBase {}