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
725 stars 29 forks source link

DisposeResources should not be called for Abstract Closures #177

Closed rbuckton closed 3 months ago

rbuckton commented 1 year ago

In GeneratorStart and AsyncGeneratorStart, the provided generatorBody parameter can be an Abstract Closure in which case the LexicalEnvironment of the running Execution Context may not be set.

We should either:

  1. Not call DisposeResources when the LexicalEnvironment is not defined (which should only be for Abstract Closures), or
  2. Move the DisposeResources call to the Evaluation for FunctionBody, as suggested in this comment.