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.
19 lines
603 B
19 lines
603 B
10 years ago
|
'use strict';
|
||
11 years ago
|
|
||
9 years ago
|
require('../common');
|
||
11 years ago
|
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 = {};
|
||
9 years ago
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
||
9 years ago
|
assert(typeof sandbox.Proxy === 'function');
|
||
11 years ago
|
assert(sandbox.Proxy !== Proxy);
|
||
|
|
||
|
// Unless we copy the Proxy object explicitly, of course.
|
||
9 years ago
|
sandbox = { Proxy: Proxy };
|
||
9 years ago
|
vm.runInNewContext('this.Proxy = Proxy', sandbox);
|
||
9 years ago
|
assert(typeof sandbox.Proxy === 'function');
|
||
11 years ago
|
assert(sandbox.Proxy === Proxy);
|