mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

Fixes: https://github.com/nodejs/node/issues/36246 PR-URL: https://github.com/nodejs/node/pull/36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
23 lines
664 B
JavaScript
23 lines
664 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; // eslint-disable-line no-unused-expressions
|
|
}
|
|
{
|
|
const pctx = tls.createSecurePair().credentials.context;
|
|
const cctx = Object.create(pctx);
|
|
assert.throws(() => cctx._external, TypeError);
|
|
pctx._external; // eslint-disable-line no-unused-expressions
|
|
}
|