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 BethGriggs committed Aug 20, 2020
1 parent 9527a2a commit 27c0653
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 27c0653

Please sign in to comment.