named-yield-identifier-strict-strict.js (967B)
1 // |reftest| error:SyntaxError 2 'use strict'; 3 // This file was procedurally generated from the following sources: 4 // - src/async-generators/yield-identifier-strict.case 5 // - src/async-generators/default/async-expression-named.template 6 /*--- 7 description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Named async generator expression) 8 esid: prod-AsyncGeneratorExpression 9 features: [async-iteration] 10 flags: [generated, onlyStrict] 11 negative: 12 phase: parse 13 type: SyntaxError 14 info: | 15 Async Generator Function Definitions 16 17 AsyncGeneratorExpression : 18 async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) { 19 AsyncGeneratorBody } 20 21 ---*/ 22 $DONOTEVALUATE(); 23 24 25 var callCount = 0; 26 27 var gen = async function *g() { 28 callCount += 1; 29 (function() { 30 var yield; 31 throw new Test262Error(); 32 }()) 33 }; 34 35 var iter = gen(); 36 37 38 39 assert.sameValue(callCount, 1);