summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-parse-abort-on-uncaught-exception.js
blob: 4fcff30321f671db2e0baac4b3a3ffde636d6d20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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 {}

try {
  new vm.Script('[', {});
} catch {}