Skip to content

Commit e4d3dbd

Browse files
addaleaxMylesBorins
authored andcommitted
test: add vm crash regression test
Refs: #34606 PR-URL: #34673 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5b2a1f1 commit e4d3dbd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const vm = require('vm');
5+
6+
// Regression test for https://github.com/nodejs/node/issues/34606
7+
8+
const handler = {
9+
getOwnPropertyDescriptor: common.mustCallAtLeast(() => {
10+
return {};
11+
})
12+
};
13+
14+
const proxy = new Proxy({}, handler);
15+
assert.throws(() => vm.runInNewContext('p = 6', proxy),
16+
/getOwnPropertyDescriptor/);

0 commit comments

Comments
 (0)