logoalt Hacker News

Adding Go's Defer to the TypeScript Compiler

17 pointsby healeycodesyesterday at 8:12 PM14 commentsview on HN

Comments

throwaway81523yesterday at 9:38 PM

Article describes try/finally as a hack to get the effect of defer, but it looks to me like it's the other way around? Try/finally is more traditional, in one form or another.

show 2 replies
geostyxtoday at 1:22 AM

I built a library to do something similar: https://www.npmjs.com/package/yaplib

defer is the thing I miss the most coming from Go

fg137today at 12:04 AM

Would call stack/source map reasonably work with this?