node/test/parallel/test-tls-external-accessor.js
Jonas a2a53cb728
tls: remove deprecated tls.createSecurePair
PR-URL: https://github.com/nodejs/node/pull/57361
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-03-11 23:01:28 +00:00

17 lines
452 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const tls = require('tls');
// Ensure accessing ._external doesn't hit an assert in the accessor method.
{
const pctx = tls.createSecureContext().context;
const cctx = { __proto__: pctx };
assert.throws(() => cctx._external, TypeError);
pctx._external; // eslint-disable-line no-unused-expressions
}