Comment

Comment by paulddraper

I don't know how to square this with your credentials, but the spec does not specify the GC behavior of closures. (This only thing it's ever said about GC was WeakMap/WeakSet in ES2015.)

I'm sorry, I literally do not understand what you are saying.

Java does closures this way. Python does closures this way. Google has considered not doing closures that way in JS. [1]

This is an intentional but extremely optional implementation choice, made for performance reasons. (See Chromium thread.)

[1] https://issues.chromium.org/issues/41070945

parent paulddraper 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton