cls-decl-async-private-gen-meth-static-args-trailing-comma-undefined.js (1520B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/arguments/args-trailing-comma-undefined.case 4 // - src/arguments/default/cls-decl-async-private-gen-meth-static.template 5 /*--- 6 description: A trailing comma after undefined should not increase the arguments.length (static class expression private generator method) 7 esid: sec-argument-lists-runtime-semantics-argumentlistevaluation 8 features: [async-iteration, class, class-static-methods-private] 9 flags: [generated, async] 10 info: | 11 Arguments : 12 ( ) 13 ( ArgumentList ) 14 ( ArgumentList , ) 15 16 ArgumentList : 17 AssignmentExpression 18 ... AssignmentExpression 19 ArgumentList , AssignmentExpression 20 ArgumentList , ... AssignmentExpression 21 22 23 Trailing comma in the arguments list 24 25 Left-Hand-Side Expressions 26 27 Arguments : 28 ( ) 29 ( ArgumentList ) 30 ( ArgumentList , ) 31 32 ArgumentList : 33 AssignmentExpression 34 ... AssignmentExpression 35 ArgumentList , AssignmentExpression 36 ArgumentList , ... AssignmentExpression 37 ---*/ 38 39 40 var callCount = 0; 41 class C { 42 static async * #method() { 43 assert.sameValue(arguments.length, 2); 44 assert.sameValue(arguments[0], 42); 45 assert.sameValue(arguments[1], undefined); 46 callCount = callCount + 1; 47 } 48 49 static get method() { 50 return this.#method; 51 } 52 } 53 54 C.method(42, undefined,).next().then(() => { 55 assert.sameValue(callCount, 1, 'method invoked exactly once'); 56 }).then($DONE, $DONE);