mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
616 B
24 lines
616 B
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
|
|
// Ensure accessing ._external doesn't hit an assert in the accessor method.
|
|
const tls = require('tls');
|
|
{
|
|
const pctx = tls.createSecureContext().context;
|
|
const cctx = Object.create(pctx);
|
|
assert.throws(() => cctx._external, /incompatible receiver/);
|
|
pctx._external;
|
|
}
|
|
{
|
|
const pctx = tls.createSecurePair().credentials.context;
|
|
const cctx = Object.create(pctx);
|
|
assert.throws(() => cctx._external, /incompatible receiver/);
|
|
pctx._external;
|
|
}
|
|
|