2020-12-14 19:10:51 +08:00
|
|
|
'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');
|
|
|
|
}));
|
|
|
|
}
|
2022-06-14 08:57:14 +02:00
|
|
|
global.gc(true);
|
|
|
|
await tick(common.platformTimeout(100));
|
2020-12-14 19:10:51 +08:00
|
|
|
global.gc();
|
2022-06-14 08:57:14 +02:00
|
|
|
await tick(common.platformTimeout(100));
|
|
|
|
global.gc();
|
|
|
|
await tick(common.platformTimeout(100));
|
2020-12-14 19:10:51 +08:00
|
|
|
})().then(common.mustCall());
|