Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes? Congratulation you know what a finalizer is?

I was replying to this:

> would very explicitly cause the GC to have semantic effects, and I think that goes strongly against the JS philosophy.

Do you disagree that a finalizer provides for exactly that and thus can not be "strongly against the JS philosophy"?



I mean it’s an explicit violation of that philosophy as noted in the proposal:

> For this reason, the W3C TAG Design Principles recommend against creating APIs that expose garbage collection. It's best if WeakRef objects and FinalizationRegistry objects are used as a way to avoid excess memory usage, or as a backstop against certain bugs, rather than as a normal way to clean up external resources or observe what's allocated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: