Browse Source

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>
v6.x
Michaël Zasso 9 years ago
committed by Rod Vagg
parent
commit
6f3f5af396
  1. 4
      test/parallel/test-vm-context.js

4
test/parallel/test-vm-context.js

@ -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');

Loading…
Cancel
Save