1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/tests/finalization_registry.js
Bartek Iwańczuk 513f921219
feat(core): pump V8 message loop on event loop tick (#11221)
This commit adds support for Atomics and FinalizationRegistry by integrating
V8's message loop into "JsRuntime::poll_event_loop".
2021-07-02 10:46:37 +02:00

20 lines
418 B
JavaScript

// Copyright 2018-2021 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();