It seems that my FinalizationRegistry isn't being called at all upon garbage collection of my DOM paragraph element.
It clearly gets GCed at some point, but the code should say "bye" after it gets GCed, yet it appears to never be called at all.
Counter class is stolen and edited from MDN's article on weak references.)
Right now it counts every second until GC, then it says that the "element is gone," but it doesn't say "bye," which is what the Registry is setup to do.
ooooh I see. Your files are not linked together. This is how your code should be:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Title</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <meta http-equiv="refresh" content="0; url=index.xhtml"> </body> </html>
.mjs files might be a problem. Can they work as