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 committed Sep 28, 2020
1 parent 4ff6c77 commit 3598056
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 3598056

Please sign in to comment.