summaryrefslogtreecommitdiff
path: root/lib/_tls_common.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-23 10:09:05 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-27 19:29:01 +0100
commit141a6e34eed05577edf43ad085a74f330d0559cb (patch)
tree1d66ed917d299069b79d34abe1493d18dcb5e138 /lib/_tls_common.js
parent5904dfcc9c70b79971ab09dacd711e5c13d7120c (diff)
downloadandroid-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.tar.gz
android-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.tar.bz2
android-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.zip
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/_tls_common.js')
-rw-r--r--lib/_tls_common.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js
index 13ff850c99..e4180a2f4d 100644
--- a/lib/_tls_common.js
+++ b/lib/_tls_common.js
@@ -22,6 +22,7 @@
'use strict';
const {
+ ArrayIsArray,
ObjectCreate,
} = primordials;
@@ -105,7 +106,7 @@ exports.createSecureContext = function createSecureContext(options) {
// Add CA before the cert to be able to load cert's issuer in C++ code.
const { ca } = options;
if (ca) {
- if (Array.isArray(ca)) {
+ if (ArrayIsArray(ca)) {
for (i = 0; i < ca.length; ++i) {
val = ca[i];
validateKeyOrCertOption('ca', val);
@@ -121,7 +122,7 @@ exports.createSecureContext = function createSecureContext(options) {
const { cert } = options;
if (cert) {
- if (Array.isArray(cert)) {
+ if (ArrayIsArray(cert)) {
for (i = 0; i < cert.length; ++i) {
val = cert[i];
validateKeyOrCertOption('cert', val);
@@ -140,7 +141,7 @@ exports.createSecureContext = function createSecureContext(options) {
const key = options.key;
const passphrase = options.passphrase;
if (key) {
- if (Array.isArray(key)) {
+ if (ArrayIsArray(key)) {
for (i = 0; i < key.length; ++i) {
val = key[i];
// eslint-disable-next-line eqeqeq
@@ -240,7 +241,7 @@ exports.createSecureContext = function createSecureContext(options) {
}
if (options.crl) {
- if (Array.isArray(options.crl)) {
+ if (ArrayIsArray(options.crl)) {
for (i = 0; i < options.crl.length; i++) {
c.context.addCRL(options.crl[i]);
}
@@ -257,7 +258,7 @@ exports.createSecureContext = function createSecureContext(options) {
if (!toBuf)
toBuf = require('internal/crypto/util').toBuf;
- if (Array.isArray(options.pfx)) {
+ if (ArrayIsArray(options.pfx)) {
for (i = 0; i < options.pfx.length; i++) {
const pfx = options.pfx[i];
const raw = pfx.buf ? pfx.buf : pfx;