Skip to content

Commit 46b2e45

Browse files
AnnaMagMylesBorins
authored andcommitted
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: #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>
1 parent a3f327f commit 46b2e45

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
require('../common');
4+
const assert = require('assert');
5+
const vm = require('vm');
6+
7+
const code = `Object.defineProperty(this, 99, {
8+
value: 20,
9+
enumerable: true
10+
});`;
11+
12+
13+
const sandbox = {};
14+
const ctx = vm.createContext(sandbox);
15+
vm.runInContext(code, ctx);
16+
17+
assert.strictEqual(sandbox[99], 20);

0 commit comments

Comments
 (0)