proposal-explicit-resource-management icon indicating copy to clipboard operation
proposal-explicit-resource-management copied to clipboard

fix a syntax error in the README snippets

Open ASafaeirad opened this issue 1 year ago • 0 comments

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

ASafaeirad avatar Jul 10 '24 12:07 ASafaeirad