2017-11-29 20:55:43 +01:00
|
|
|
// Flags: --abort-on-uncaught-exception
|
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const vm = require('vm');
|
|
|
|
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/13258
|
|
|
|
|
|
|
|
try {
|
|
|
|
new vm.Script({ toString() { throw new Error('foo'); } }, {});
|
2022-02-02 22:35:32 -08:00
|
|
|
} catch {
|
|
|
|
// Continue regardless of error.
|
|
|
|
}
|
2017-11-29 20:55:43 +01:00
|
|
|
|
|
|
|
try {
|
|
|
|
new vm.Script('[', {});
|
2022-02-02 22:35:32 -08:00
|
|
|
} catch {
|
|
|
|
// Continue regardless of error.
|
|
|
|
}
|