Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnnaMag <AnnaMag@users.noreply.github.com>2017-03-09 17:00:34 +0300
committerItalo A. Casas <me@italoacasas.com>2017-03-20 17:37:15 +0300
commit2649dab2744b98d7733275a12835e127084b5cb1 (patch)
tree0a77181bb403b883b9ba138b1839508fb67955c1 /test
parent2df662c95a48ebef22f09c91497466fea732483b (diff)
test: added test for indexed properties
Currently, indexed properties are correctly copied onto the sandbox by CopyProperties(). This will break when CopyProperties() is removed after adjusting NamedPropertyHandlerConfiguration config() to use property callbacks from the new V8 API. To fix it, we will set a config for indexed properties. This test is a preparation step for the patch that removes CopyProperties(). PR-URL: https://github.com/nodejs/node/pull/11769 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-vm-indexed-properties.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/parallel/test-vm-indexed-properties.js b/test/parallel/test-vm-indexed-properties.js
new file mode 100644
index 00000000000..34ef8d020b2
--- /dev/null
+++ b/test/parallel/test-vm-indexed-properties.js
@@ -0,0 +1,17 @@
+'use strict';
+
+require('../common');
+const assert = require('assert');
+const vm = require('vm');
+
+const code = `Object.defineProperty(this, 99, {
+ value: 20,
+ enumerable: true
+ });`;
+
+
+const sandbox = {};
+const ctx = vm.createContext(sandbox);
+vm.runInContext(code, ctx);
+
+assert.strictEqual(sandbox[99], 20);