11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciif (!common.hasCrypto) 51cb0ef41Sopenharmony_ci common.skip('missing crypto'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst assert = require('assert'); 81cb0ef41Sopenharmony_ciconst tls = require('tls'); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci// Ensure accessing ._external doesn't hit an assert in the accessor method. 111cb0ef41Sopenharmony_ci{ 121cb0ef41Sopenharmony_ci const pctx = tls.createSecureContext().context; 131cb0ef41Sopenharmony_ci const cctx = Object.create(pctx); 141cb0ef41Sopenharmony_ci assert.throws(() => cctx._external, TypeError); 151cb0ef41Sopenharmony_ci pctx._external; // eslint-disable-line no-unused-expressions 161cb0ef41Sopenharmony_ci} 171cb0ef41Sopenharmony_ci{ 181cb0ef41Sopenharmony_ci const pctx = tls.createSecurePair().credentials.context; 191cb0ef41Sopenharmony_ci const cctx = Object.create(pctx); 201cb0ef41Sopenharmony_ci assert.throws(() => cctx._external, TypeError); 211cb0ef41Sopenharmony_ci pctx._external; // eslint-disable-line no-unused-expressions 221cb0ef41Sopenharmony_ci} 23