Re:TypeScript 5.2's New Keyword: 'using'
by semiquaver on Tuesday June 20, 2023 @09:51AM
(#36403958)
No, since these are block-scoped the original variable goes out of scope when the block it was declared in ends. The underlying _value_ that the variable is a reference to certainly can escape the block in a number of ways (assignments to existing variables or properties, closures), but this system doesn’t care about any of that, it’s directly equivalent to using try and finally, and finally blocks execute when you would expect them to.
[ Parent
| on HN ]
There are no comments on this comment yet.