mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
b6738c1af0
PR-URL: https://github.com/nodejs/node/pull/47498 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
19 lines
458 B
JavaScript
19 lines
458 B
JavaScript
'use strict';
|
|
require('../../common');
|
|
const vm = require('vm');
|
|
|
|
console.error('beginning');
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/7397:
|
|
// vm.runInThisContext() should not print out anything to stderr by itself.
|
|
try {
|
|
vm.runInThisContext(`throw ({
|
|
name: 'MyCustomError',
|
|
message: 'This is a custom message'
|
|
})`, { filename: 'test.vm' });
|
|
} catch (e) {
|
|
console.error('received error', e.name);
|
|
}
|
|
|
|
console.error('end');
|