mirror of
https://github.com/nodejs/node.git
synced 2025-05-21 21:51:52 +00:00

V8 considers gc(true) legacy, and the new signature is much more expressive. PR-URL: https://github.com/nodejs/node/pull/43493 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
26 lines
775 B
JavaScript
26 lines
775 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({ type: 'minor' });
|
|
await tick(common.platformTimeout(100));
|
|
global.gc();
|
|
await tick(common.platformTimeout(100));
|
|
global.gc();
|
|
await tick(common.platformTimeout(100));
|
|
})().then(common.mustCall());
|