镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit 2649dab

Browse files
AnnaMagItalo A. Casas
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 2df662c commit 2649dab

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
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)