2020-12-14 19:10:51 +08:00
|
|
|
'use strict';
|
|
|
|
// Flags: --no-force-node-api-uncaught-exceptions-policy
|
|
|
|
|
|
|
|
const common = require('../../common');
|
2023-09-25 12:23:58 +08:00
|
|
|
const binding = require(`./build/${common.buildType}/test_uncaught_exception_v9`);
|
2020-12-14 19:10:51 +08:00
|
|
|
|
|
|
|
process.on(
|
|
|
|
'uncaughtException',
|
|
|
|
common.mustNotCall('uncaught callback errors should be suppressed ' +
|
2023-01-25 07:05:53 +01:00
|
|
|
'with the option --no-force-node-api-uncaught-exceptions-policy'),
|
2020-12-14 19:10:51 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
binding.CallIntoModule(
|
|
|
|
common.mustCall(() => {
|
|
|
|
throw new Error('callback error');
|
|
|
|
}),
|
|
|
|
{},
|
|
|
|
'resource_name',
|
|
|
|
common.mustCall(function finalizer() {
|
|
|
|
throw new Error('finalizer error');
|
2023-01-25 07:05:53 +01:00
|
|
|
}),
|
2020-12-14 19:10:51 +08:00
|
|
|
);
|