mirror of https://github.com/lukechilds/node.git
Browse Source
* Restrict the receiver to instances of the FunctionTemplate. * Use `args.This()` instead of `args.Holder()`. Fixes: https://github.com/nodejs/node/issues/3682 PR-URL: https://github.com/nodejs/node/pull/5521 Reviewed-By: Fedor Indutny <fedor@indutny.com>v5.x
Ben Noordhuis
9 years ago
committed by
Jeremiah Senkpiel
2 changed files with 48 additions and 21 deletions
@ -0,0 +1,24 @@ |
|||
'use strict'; |
|||
|
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
if (!common.hasCrypto) { |
|||
console.log('1..0 # Skipped: 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; |
|||
} |
Loading…
Reference in new issue