Skip to content

Commit

Permalink
Add test for inherited properties for issue nodejs#5350
Browse files Browse the repository at this point in the history
  • Loading branch information
fhinkel committed Jul 28, 2016
1 parent aef3aed commit 0011a65
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/parallel/test-vm-inherited-properties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/nodejs/node/issues/5350
'use strict';
require('../common');
const vm = require('vm');
const assert = require('assert');

var base = Object.create(null);
base.x = 1;
base.y = 2;

var sandbox = Object.create(base);
sandbox.z = 3;

const code = 'x = 0; z = 4;';
vm.runInNewContext(code, sandbox);

assert((Object.keys(sandbox)).indexOf('y') === -1);

0 comments on commit 0011a65

Please sign in to comment.