params-trailing-comma-multiple.js (1295B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/params-trailing-comma-multiple.case 4 // - src/function-forms/default/async-gen-func-expr.template 5 /*--- 6 description: A trailing comma should not increase the respective length, using multiple parameters (async generator function expression) 7 esid: sec-asyncgenerator-definitions-evaluation 8 features: [async-iteration] 9 flags: [generated, async] 10 info: | 11 AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { 12 AsyncGeneratorBody } 13 14 [...] 15 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, 16 AsyncGeneratorBody, scope, strict). 17 [...] 18 19 20 Trailing comma in the parameters list 21 22 14.1 Function Definitions 23 24 FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , 25 ---*/ 26 27 28 var callCount = 0; 29 // Stores a reference `ref` for case evaluation 30 var ref; 31 ref = async function*(a, b,) { 32 assert.sameValue(a, 42); 33 assert.sameValue(b, 39); 34 callCount = callCount + 1; 35 }; 36 37 ref(42, 39, 1).next().then(() => { 38 assert.sameValue(callCount, 1, 'generator function invoked exactly once'); 39 }).then($DONE, $DONE); 40 41 assert.sameValue(ref.length, 2, 'length is properly set');