Debian Codegraph @

js/src/tests/test262/language/arguments-object/cls-expr-gen-meth-args-trailing-comma-multiple.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/arguments/args-trailing-comma-multiple.case
3 // - src/arguments/default/cls-expr-gen-meth.template
4 /*---
5 description: A trailing comma should not increase the arguments.length, using multiple args (class expression generator method)
6 esid: sec-arguments-exotic-objects
7 features: [generators]
8 flags: [generated]
9 info: |
10 9.4.4 Arguments Exotic Objects
11
12 Most ECMAScript functions make an arguments object available to their code. Depending upon the
13 characteristics of the function definition, its arguments object is either an ordinary object
14 or an arguments exotic object.
15
16
17 Trailing comma in the arguments list
18
19 Left-Hand-Side Expressions
20
21 Arguments :
22 ( )
23 ( ArgumentList )
24 ( ArgumentList , )
25
26 ArgumentList :
27 AssignmentExpression
28 ... AssignmentExpression
29 ArgumentList , AssignmentExpression
30 ArgumentList , ... AssignmentExpression
31 ---*/
32
33
34 var callCount = 0;
35 var C = class {
36 *method() {
37 assert.sameValue(arguments.length, 2);
38 assert.sameValue(arguments[0], 42);
39 assert.sameValue(arguments[1], 'TC39');
40 callCount = callCount + 1;
41 }
42 };
43
44 C.prototype.method(42, 'TC39',).next();
45
46 // Stores a reference `ref` for case evaluation
47 var ref = C.prototype.method;
48
49 assert.sameValue(callCount, 1, 'method invoked exactly once');
50
51 reportCompare(0, 0);