proposal-explicit-resource-management
proposal-explicit-resource-management copied to clipboard
fix a syntax error in the README snippets
In the README, a code snippet uses the "stream" variable to close the stream, but it is defined as "handle". This PR renames the "handle" variable to "stream".
async function * g() {
const handle = acquireStream(); // critical resource
try {
...
}
finally {
await stream.close(); // cleanup
}
}