nameless-params-trailing-comma-multiple.js (1118B)
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-func-expr-nameless.template 5 /*--- 6 description: A trailing comma should not increase the respective length, using multiple parameters (async function nameless expression) 7 esid: sec-async-function-definitions 8 features: [async-functions] 9 flags: [generated, async] 10 info: | 11 14.6 Async Function Definitions 12 13 AsyncFunctionExpression : 14 async function ( FormalParameters ) { AsyncFunctionBody } 15 16 17 Trailing comma in the parameters list 18 19 14.1 Function Definitions 20 21 FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , 22 ---*/ 23 24 25 var callCount = 0; 26 27 // Stores a reference `ref` for case evaluation 28 var ref; 29 ref = async function(a, b,) { 30 assert.sameValue(a, 42); 31 assert.sameValue(b, 39); 32 callCount = callCount + 1; 33 }; 34 35 ref(42, 39, 1).then(() => { 36 assert.sameValue(callCount, 1, 'function invoked exactly once'); 37 }).then($DONE, $DONE); 38 39 assert.sameValue(ref.length, 2, 'length is properly set');