node-api: enable uncaught exceptions policy by default

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>
This commit is contained in:
Chengzhong Wu 2023-09-25 12:23:58 +08:00 committed by GitHub
parent 448996cf95
commit 77597d3aea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 307 additions and 133 deletions

View file

@ -0,0 +1,8 @@
'use strict';
// Flags: --force-node-api-uncaught-exceptions-policy
const common = require('../../common');
const binding = require(`./build/${common.buildType}/test_uncaught_exception_v9`);
const { testUncaughtException } = require('./uncaught_exception');
testUncaughtException(binding);