tc39 / proposal-explicit-resource-management

ECMAScript Explicit Resource Management
https://arai-a.github.io/ecma262-compare/?pr=3000
BSD 3-Clause "New" or "Revised" License
735 stars 29 forks source link

fix a syntax error in the README snippets #236

Open ASafaeirad opened 2 weeks ago

ASafaeirad commented 2 weeks ago

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
  }
}