• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3require('../common');
4const assert = require('assert');
5const vm = require('vm');
6
7// src/node_contextify.cc filters out the Proxy object from the parent
8// context.  Make sure that the new context has a Proxy object of its own.
9let sandbox = {};
10vm.runInNewContext('this.Proxy = Proxy', sandbox);
11assert.strictEqual(typeof sandbox.Proxy, 'function');
12assert.notStrictEqual(sandbox.Proxy, Proxy);
13
14// Unless we copy the Proxy object explicitly, of course.
15sandbox = { Proxy };
16vm.runInNewContext('this.Proxy = Proxy', sandbox);
17assert.strictEqual(typeof sandbox.Proxy, 'function');
18assert.strictEqual(sandbox.Proxy, Proxy);
19