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 Aug 10, 2020
1 parent b8b5e1e commit 64acae2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-vm-set-property-proxy.js
@@ -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 64acae2

Please sign in to comment.