Skip to content

Commit 2649dab

Browse files
AnnaMagitaloacasas
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
1 parent 2df662c commit 2649dab

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)