head-lhs-async.js (690B)
1 // |reftest| async 2 // Copyright (C) 2021 Stuart Cook. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-for-in-and-for-of-statements 7 description: > 8 The left-hand-side of a for-await-of loop may be the identifier `async`. 9 info: | 10 ForInOfStatement[Yield, Await, Return]: 11 [+Await] for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] 12 features: [async-iteration] 13 flags: [async] 14 ---*/ 15 16 let async; 17 18 async function fn() { 19 for await (async of [7]); 20 } 21 22 fn() 23 .then(() => assert.sameValue(async, 7), $DONE) 24 .then($DONE, $DONE);