mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 05:30:00 +00:00

PR-URL: https://github.com/nodejs/node/pull/29874 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
14 lines
245 B
JavaScript
14 lines
245 B
JavaScript
'use strict';
|
|
|
|
// Flags: --expose-gc --harmony-weak-refs
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
const w = new globalThis.WeakRef({});
|
|
|
|
setTimeout(() => {
|
|
globalThis.gc();
|
|
assert.strictEqual(w.deref(), undefined);
|
|
}, 200);
|