Skip to content

Commit

Permalink
test: added test for indexed properties
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AnnaMag authored and MylesBorins committed Apr 19, 2017
1 parent a3f327f commit 46b2e45
Showing 1 changed file with 17 additions and 0 deletions.
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);

0 comments on commit 46b2e45

Please sign in to comment.