Skip to content

Incorrect usage of InitializeReferencedBinding AO in ForIn/OfBodyEvaluation #172

@rbuckton

Description

@rbuckton

Steps 4-6 of ForIn/OfBodyEvaluation define the hint variable, which is intended to be passed to the InitializeReferencedBinding AO on steps 9.h.vii.5-6. This is necessary to correctly initialize a resource that uses Symbol.asyncDispose in the following statement:

for (await using x of y) {
}

The steps 9.h.vii.5-6 are currently

  1. If IsUsingDeclaration of lhs is true, then
    1. Let status be Completion(InitializeReferencedBinding(lhsRef, nextValue, sync-dispose)).
  2. Else,
    1. Let status be Completion(InitializeReferencedBinding(lhsRef, nextValue, normal)).

but should be

  1. Let status be Completion(InitializeReferencedBinding(lhsRef, nextValue, hint)).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions