mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 01:31:27 +00:00

PR-URL: https://github.com/nodejs/node/pull/36510 Fixes: https://github.com/nodejs/node/issues/36402 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
21 lines
564 B
JavaScript
21 lines
564 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc --force-node-api-uncaught-exceptions-policy
|
|
|
|
const common = require('../../common');
|
|
const test_reference = require(`./build/${common.buildType}/test_reference`);
|
|
const assert = require('assert');
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.throws(() => { throw err; }, /finalizer error/);
|
|
}));
|
|
|
|
(async function() {
|
|
{
|
|
test_reference.createExternalWithJsFinalize(
|
|
common.mustCall(() => {
|
|
throw new Error('finalizer error');
|
|
}));
|
|
}
|
|
global.gc();
|
|
})().then(common.mustCall());
|