nodejs-mozilla/test/parallel/test-vm-script-throw-in-tos...

15 lines
204 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const vm = require('vm');
assert.throws(() => {
new vm.Script({
toString() {
throw new Error();
}
});
}, Error);