Incrementally making `require('../common')` less of a monolith.
Move the `common.onGC()` utility to a separate standalone module
that is only imported when it's actually needed.
PR-URL: https://github.com/nodejs/node/pull/22446
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
14 lines
243 B
JavaScript
14 lines
243 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc
|
|
const common = require('../common');
|
|
const onGC = require('../common/ongc');
|
|
|
|
{
|
|
onGC({}, { ongc: common.mustCall() });
|
|
global.gc();
|
|
}
|
|
|
|
{
|
|
onGC(process, { ongc: common.mustNotCall() });
|
|
global.gc();
|
|
}
|