summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-parse-abort-on-uncaught-exception.js
blob: 36f73ea676e5a5ebaa8d728c0f8156a558c23fc0 (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 (err) {}

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