test: add regression test for Proxy as vm context

A Proxy context should not hide built-in global objects.
Ref: https://github.com/nodejs/node/issues/6158

PR-URL: https://github.com/nodejs/node/pull/6967
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Michaël Zasso 2016-05-25 10:42:30 +02:00
parent 048b3de22d
commit f9ea52e5eb
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -72,3 +72,7 @@ assert.throws(function() {
}, function(err) {
return /expected-filename.js:33:130/.test(err.stack);
}, 'Expected appearance of proper offset in Error stack');
// https://github.com/nodejs/node/issues/6158
ctx = new Proxy({}, {});
assert.strictEqual(typeof vm.runInNewContext('String', ctx), 'function');