1'use strict'; 2require('../../common'); 3const vm = require('vm'); 4 5console.error('beginning'); 6 7// Regression test for https://github.com/nodejs/node/issues/7397: 8// vm.runInThisContext() should not print out anything to stderr by itself. 9try { 10 vm.runInThisContext(`throw ({ 11 name: 'MyCustomError', 12 message: 'This is a custom message' 13 })`, { filename: 'test.vm' }); 14} catch (e) { 15 console.error('received error', e.name); 16} 17 18console.error('end'); 19