mirror of
https://github.com/denoland/deno.git
synced 2024-12-14 19:37:59 -05:00
1fb5858009
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
20 lines
418 B
JavaScript
20 lines
418 B
JavaScript
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
|
"use strict";
|
|
|
|
function assertEquals(a, b) {
|
|
if (a === b) return;
|
|
throw a + " does not equal " + b;
|
|
}
|
|
|
|
const registry = new FinalizationRegistry((value) => {
|
|
assertEquals(value, "called!");
|
|
Deno.core.print("FinalizationRegistry called!\n");
|
|
});
|
|
|
|
(function () {
|
|
let x = {};
|
|
registry.register(x, "called!");
|
|
x = null;
|
|
})();
|
|
|
|
gc();
|