mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 19:56:48 +00:00

This `_external` getter is essential for some libs to work: uWebSockets as an example. PR-URL: https://github.com/nodejs/node/pull/21711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
23 lines
574 B
JavaScript
23 lines
574 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 = Object.create(pctx);
|
|
assert.throws(() => cctx._external, TypeError);
|
|
pctx._external;
|
|
}
|
|
{
|
|
const pctx = tls.createSecurePair().credentials.context;
|
|
const cctx = Object.create(pctx);
|
|
assert.throws(() => cctx._external, TypeError);
|
|
pctx._external;
|
|
}
|