summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 58a4c8a2f2..aa6c764491 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -23,6 +23,19 @@ assert.equal(util.inspect(a), '[ \'foo\', , \'baz\' ]');
assert.equal(util.inspect(a, true), '[ \'foo\', , \'baz\', [length]: 3 ]');
assert.equal(util.inspect(new Array(5)), '[ , , , , ]');
+// test for Array constructor in different context
+const Debug = require('vm').runInDebugContext('Debug');
+var map = new Map();
+map.set(1, 2);
+var mirror = Debug.MakeMirror(map.entries(), true);
+var vals = mirror.preview();
+var valsOutput = [];
+for (let o of vals) {
+ valsOutput.push(o);
+}
+
+assert.strictEqual(util.inspect(valsOutput), '[ [ 1, 2 ] ]');
+
// test for property descriptors
var getter = Object.create(null, {
a: {