From 6f3f5af396276182ab4089cb9e0842d2231c5a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 25 May 2016 10:42:30 +0200 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- test/parallel/test-vm-context.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index 48bceb1459..ce648b7fb7 100644 --- a/test/parallel/test-vm-context.js +++ b/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');