Skip to content

Commit

Permalink
confirm the change fixes nodejs#43129
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Feb 11, 2023
1 parent 4a510b0 commit 355a1b9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/parallel/test-vm-not-strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint-disable strict, no-var, no-delete-var */
// Related to bug report: https://github.com/nodejs/node/issues/43129
require('../common');
var assert = require('assert');
var vm = require('vm');

var data = [];
var a = 'direct';
delete a;
data.push(a);

var item2 = vm.runInThisContext(`
var data = [];
var b = "this";
delete b;
data.push(b);
data[0]
`);
data.push(item2);

vm.runInContext(
`
var c = "new";
delete c;
data.push(c);
`,
vm.createContext({ data: data })
);

assert.deepStrictEqual(data, ['direct', 'this', 'new']);

0 comments on commit 355a1b9

Please sign in to comment.