summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-script-throw-in-tostring.js
blob: 20e7a75079b33c081cfb00c05119eb0947dbc9d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';

require('../common');
const assert = require('assert');

const vm = require('vm');

assert.throws(() => {
  new vm.Script({
    toString() {
      throw new Error();
    }
  });
}, Error);