ladybird/Tests/LibWeb/Crash/JS/finalization-registry-basic.html
Shannon Booth b17746eb94 Tests/LibWeb: Fix file path for crash test script src
Simply meaning the test would never get the internals object.
2025-02-10 09:25:09 +00:00

20 lines
407 B
HTML

<script src="../../Text/input/include.js"></script>
<script>
// NOTE: This test is only reliable when GC'ing after each allocation.
const registry = new FinalizationRegistry((heldValue) => {
console.log(heldValue);
});
const makeGarbage = () => {
registry.register(new String("ok"), "hello");
};
makeGarbage();
if (window.internals !== undefined)
internals.gc();
println("PASS");
</script>