Skip to content

Commit

Permalink
test: add vm crash regression test
Browse files Browse the repository at this point in the history
Refs: #34606
PR-URL: #34673
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and MylesBorins committed Aug 17, 2020
1 parent 5b2a1f1 commit e4d3dbd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-vm-set-property-proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'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),
/getOwnPropertyDescriptor/);

0 comments on commit e4d3dbd

Please sign in to comment.