This enables the option `--force-node-api-uncaught-exceptions-policy` for a specific Node-API addon when it is compiled with `NAPI_EXPERIMENTAL` (and this would be the default behavior when `NAPI_VERSION` 10 releases). This would not break existing Node-API addons. PR-URL: https://github.com/nodejs/node/pull/49313 Refs: https://github.com/nodejs/node/pull/36510 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
23 lines
588 B
JavaScript
23 lines
588 B
JavaScript
'use strict';
|
|
// Flags: --no-force-node-api-uncaught-exceptions-policy
|
|
|
|
const common = require('../../common');
|
|
const binding = require(`./build/${common.buildType}/test_uncaught_exception_v9`);
|
|
|
|
process.on(
|
|
'uncaughtException',
|
|
common.mustNotCall('uncaught callback errors should be suppressed ' +
|
|
'with the option --no-force-node-api-uncaught-exceptions-policy'),
|
|
);
|
|
|
|
binding.CallIntoModule(
|
|
common.mustCall(() => {
|
|
throw new Error('callback error');
|
|
}),
|
|
{},
|
|
'resource_name',
|
|
common.mustCall(function finalizer() {
|
|
throw new Error('finalizer error');
|
|
}),
|
|
);
|