kakashi_69_xd
kakashi_69_xd
DDeno
Created by kakashi_69_xd on 4/22/2024 in #help
Finalization not working
I can't get the gc to run a destructor.. At first I thought that I'm making some kind of mistake here but I don't know where.. I was trying to make a Drop trait
abstract class Drop {
#registry=new FinalizationRegistry((_)=> this.drop());
constructor() {
this.#registery.register(this, "");
}
protected abstract drop(): void;
}

class Foo extends Drop {
protected drop(): void {
console.log("Foo was dropped");
}
}

const _foo=new Foo();
abstract class Drop {
#registry=new FinalizationRegistry((_)=> this.drop());
constructor() {
this.#registery.register(this, "");
}
protected abstract drop(): void;
}

class Foo extends Drop {
protected drop(): void {
console.log("Foo was dropped");
}
}

const _foo=new Foo();
Then I tried to copy some code that seemed to work from a conf and also mdn but the destructor was never called..
const obj={ xd: "xd" };

const registry=new FinalizationRegistry (heldValue=> console.log(`${heldValue} was dropped`));

registery.register(obj,obj.xd);
const obj={ xd: "xd" };

const registry=new FinalizationRegistry (heldValue=> console.log(`${heldValue} was dropped`));

registery.register(obj,obj.xd);
8 replies
DDeno
Created by kakashi_69_xd on 2/8/2024 in #help
deno_bindgen release 9.0
@divy When is it coming? I've been waiting for a while for release 9.0... Is there any work going on? I've been out for a while as I had board exams thinking it'll be released by the eding of the exam. But there's still no response to any issues or anything.. Should I move on and write my library manually?
4 replies