I have some reservations about the specification - it looks like there are a lot of caveats to how it can be used. For example, it's allowed in for and for-of loops, but not in for-in loops. Also looks like destructuring will not be allowed.
using res = getResource();
const { x, y } = res; // ok
using { x, y } = getResource(); // error
There is literally an example for using destructuring in the linked article. So it is supported.
Can you clarify where it indicates it's supported i.e. which specific example? I re read and didn't see it myself, seems others are missing it.
To be fair I don't see it not being supported either by the examples.
The last example:
{
await using { connection } = getConnection();
// Do stuff with connection
} // Automatically closed!
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...