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