cls-decl-async-private-gen-meth-static-args-trailing-comma-single-args.js (1468B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/arguments/args-trailing-comma-single-args.case 4 // - src/arguments/default/cls-decl-async-private-gen-meth-static.template 5 /*--- 6 description: A trailing comma should not increase the arguments.length, using a single arg (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, 1); 44 assert.sameValue(arguments[0], 42); 45 callCount = callCount + 1; 46 } 47 48 static get method() { 49 return this.#method; 50 } 51 } 52 53 C.method(42,).next().then(() => { 54 assert.sameValue(callCount, 1, 'method invoked exactly once'); 55 }).then($DONE, $DONE);