Skip to content

Commit

Permalink
test: add vm crash regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Aug 7, 2020
1 parent 2b0a451 commit bd0ccf2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-vm-set-property-proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const vm = require('vm');

// Regression test for https://github.com/nodejs/node/issues/34606

const handler = {
getOwnPropertyDescriptor: common.mustCallAtLeast(() => {
return {};
})
};

const proxy = new Proxy({}, handler);
assert.throws(() => vm.runInNewContext('p = 6', proxy));

0 comments on commit bd0ccf2

Please sign in to comment.