Skip to content

test-dns-promises-exists.js cannot detect setDefaultResultOrder is missing from dns/promises #43198

Answered by aduh95
F3n67u asked this question in General
Discussion options

You must be logged in to vote

When you write fs/promises, do you mean dns/promises? I'm going to assume that yes, but you wrote it four times in a row, so not sure.

There's a bug in the code where properties are added to node:dns/promises only if someone tries to access require('node:dns').promises:

node/lib/dns.js

Lines 382 to 391 in b5ed1bd

ObjectDefineProperties(module.exports, {
promises: {
configurable: true,
enumerable: true,
get() {
if (promises === null) {
promises = require('internal/dns/promises');
promises.setServers = defaultResolverSetServers;
promises.setDefaultResultOrder = setDefaultResultOrder;
}

I think that was added at a time where node…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@F3n67u
Comment options

F3n67u May 26, 2022
Collaborator Author

@aduh95
Comment options

@F3n67u
Comment options

F3n67u May 27, 2022
Collaborator Author

@F3n67u
Comment options

F3n67u May 28, 2022
Collaborator Author

Answer selected by F3n67u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants