Created
July 21, 2020 04:42
-
-
Save alexcrichton/5eb392f514bad5142df90f376a4e8654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = new FinalizationRegistry(v => { | |
console.log('a'); | |
console.log('b', v); | |
for (const val in v) { | |
console.log(val); | |
} | |
}); | |
function f() { | |
const obj = {a: 3}; | |
a.register(obj, { b: 3}); | |
} | |
f(); | |
console.log('before gc'); | |
global.gc(); | |
console.log('after gc'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment