node/test/message/vm_display_runtime_error.js
Marcel Laverdet 6e60c838c9
vm: fix displayErrors in runIn.. functions
This option has been broken for almost a year when used with any of the
vm.runIn.. family of functions, except for syntax errors.

Backport-PR-URL: https://github.com/nodejs/node/pull/14373
PR-URL: https://github.com/nodejs/node/pull/13074
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-30 23:11:12 -05:00

15 lines
318 B
JavaScript

'use strict';
require('../common');
const vm = require('vm');
console.error('beginning');
try {
vm.runInThisContext('throw new Error("boo!")', { filename: 'test.vm'});
} catch (err) {
console.error(err.stack);
}
vm.runInThisContext('throw new Error("spooky!")', { filename: 'test.vm' });
console.error('end');