Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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().
  • Loading branch information
AnnaMag committed Mar 9, 2017
commit b4b59add471778f7266a2406fc22acc42aa9ce33
17 changes: 17 additions & 0 deletions test/parallel/test-vm-indexed-properties.js
Original file line number Diff line number Diff line change
@@ -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);