mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
d495e40bf7
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>
15 lines
243 B
JavaScript
15 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();
|
|
}
|