Re:TypeScript 5.2's New Keyword: 'using'
by masklinn on Monday June 19, 2023 @11:29AM
(#36392206)
The last example:
edit: according to the ES proposal issues, this might be something that doesn't actually exist, on purpose (it's rather ambiguous as to what will be disposed of): https://github.com/tc39/proposal-explicit-resource-managemen...
[ Parent
| on HN ]
Thanks! Yes that example is subtly different.
I did also click through to the proposal but didn't see that issue. It does seem like it's still unclear what's intentional or not.
Re:TypeScript 5.2's New Keyword: 'using'
by pwdisswordfishc on Monday June 19, 2023 @02:40PM
(#36394953)
It’s intentional. The grammar production in the proposal is parametrized as ~Pattern (a parameter introduced in the proposal), which means it does not allow destructuring.
https://tc39.es/proposal-explicit-resource-management/#prod-...