2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2014-01-30 13:21:07 +01:00
|
|
|
|
2015-12-23 16:02:12 -08:00
|
|
|
require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const assert = require('assert');
|
|
|
|
const vm = require('vm');
|
2014-01-30 13:21:07 +01:00
|
|
|
|
|
|
|
// src/node_contextify.cc filters out the Proxy object from the parent
|
|
|
|
// context. Make sure that the new context has a Proxy object of its own.
|
2017-01-08 13:19:00 +00:00
|
|
|
let sandbox = {};
|
2015-12-26 22:08:08 -08:00
|
|
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
2016-09-17 12:32:33 +02:00
|
|
|
assert.strictEqual(typeof sandbox.Proxy, 'function');
|
|
|
|
assert.notStrictEqual(sandbox.Proxy, Proxy);
|
2014-01-30 13:21:07 +01:00
|
|
|
|
|
|
|
// Unless we copy the Proxy object explicitly, of course.
|
2018-01-11 19:03:58 +01:00
|
|
|
sandbox = { Proxy };
|
2015-12-26 22:08:08 -08:00
|
|
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
2016-09-17 12:32:33 +02:00
|
|
|
assert.strictEqual(typeof sandbox.Proxy, 'function');
|
|
|
|
assert.strictEqual(sandbox.Proxy, Proxy);
|