Hacker News new | ask | show | jobs
by nix 5696 days ago
When the continuation gets invoked by the event-handling loop, the stack is reset.

You're not compiling to C here: "the stack" may be a chain of heap-allocated activation records that are still live as far as GC is concerned. What you're describing might work but you'd want to test it to be sure.

EDIT: On reflection I agree that the setTimeout() approach should free the stack, however it's implemented.