2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2014-01-30 13:21:07 +01:00
|
|
|
|
2015-12-24 01:02:12 +01:00
|
|
|
require('../common');
|
2014-01-30 13:21:07 +01:00
|
|
|
var assert = require('assert');
|
|
|
|
var vm = require('vm');
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
var sandbox = {};
|
2015-12-27 07:08:08 +01:00
|
|
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
2016-01-22 09:24:50 +01:00
|
|
|
assert(typeof sandbox.Proxy === 'function');
|
2014-01-30 13:21:07 +01:00
|
|
|
assert(sandbox.Proxy !== Proxy);
|
|
|
|
|
|
|
|
// Unless we copy the Proxy object explicitly, of course.
|
2016-01-31 07:44:26 +01:00
|
|
|
sandbox = { Proxy: Proxy };
|
2015-12-27 07:08:08 +01:00
|
|
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
2016-01-22 09:24:50 +01:00
|
|
|
assert(typeof sandbox.Proxy === 'function');
|
2014-01-30 13:21:07 +01:00
|
|
|
assert(sandbox.Proxy === Proxy);
|