blob: 64bbb4dd4fcb986f604fc35ff476ac6d00566270 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// Flags: --abort-on-uncaught-exception
'use strict';
require('../common');
const vm = require('vm');
// Regression test for https://github.com/nodejs/node/issues/13258
try {
new vm.Script({ toString() { throw new Error('foo'); } }, {});
} catch {
// Continue regardless of error.
}
try {
new vm.Script('[', {});
} catch {
// Continue regardless of error.
}
|