// |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) module -- explicit-resource-management is not enabled unconditionally, requires shell-options// Copyright (C) 2023 Ron Buckton. All rights reserved.// This code is governed by the BSD license found in the LICENSE file./*---esid: sec-for-in-and-for-of-statementsdescription: > ForDeclaration containing 'await using' creates a fresh binding per iterationflags: [module]features: [explicit-resource-management]---*/letf=[undefined,undefined,undefined];constobj1={async[Symbol.asyncDispose](){}};constobj2={async[Symbol.asyncDispose](){}};constobj3={async[Symbol.asyncDispose](){}};leti=0;for(awaitusingxof[obj1,obj2,obj3]){f[i++]=function(){returnx;};}assert.sameValue(f[0](),obj1,"`f[0]()` returns `obj1`");assert.sameValue(f[1](),obj2,"`f[1]()` returns `obj2`");assert.sameValue(f[2](),obj3,"`f[2]()` returns `obj3`");reportCompare(0,0);