diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-11-23 12:09:05 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-11-27 21:29:01 +0300 |
commit | 141a6e34eed05577edf43ad085a74f330d0559cb (patch) | |
tree | 1d66ed917d299069b79d34abe1493d18dcb5e138 /lib/internal/dns | |
parent | 5904dfcc9c70b79971ab09dacd711e5c13d7120c (diff) |
lib: enforce use of Array from primordials
PR-URL: https://github.com/nodejs/node/pull/30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/internal/dns')
-rw-r--r-- | lib/internal/dns/utils.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js index 226d134680a..18ad6bfad7a 100644 --- a/lib/internal/dns/utils.js +++ b/lib/internal/dns/utils.js @@ -1,4 +1,9 @@ 'use strict'; + +const { + ArrayIsArray, +} = primordials; + const errors = require('internal/errors'); const { isIP } = require('internal/net'); const { @@ -38,7 +43,7 @@ class Resolver { } setServers(servers) { - if (!Array.isArray(servers)) { + if (!ArrayIsArray(servers)) { throw new ERR_INVALID_ARG_TYPE('servers', 'Array', servers); } |