mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 22:40:57 +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>
22 lines
617 B
JavaScript
22 lines
617 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc --force-node-api-uncaught-exceptions-policy
|
|
|
|
const common = require('../../common');
|
|
const binding = require(`./build/${common.buildType}/test_buffer`);
|
|
const assert = require('assert');
|
|
const tick = require('util').promisify(require('../../common/tick'));
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.throws(() => { throw err; }, /finalizer error/);
|
|
}));
|
|
|
|
(async function() {
|
|
{
|
|
binding.malignFinalizerBuffer(common.mustCall(() => {
|
|
throw new Error('finalizer error');
|
|
}));
|
|
}
|
|
global.gc();
|
|
await tick(10);
|
|
})().then(common.mustCall());
|