tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

cls-expr-private-gen-meth-static-args-trailing-comma-multiple.js (1492B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/arguments/args-trailing-comma-multiple.case
      3 // - src/arguments/default/cls-expr-private-gen-meth-static.template
      4 /*---
      5 description: A trailing comma should not increase the arguments.length, using multiple args (static class expression private generator method)
      6 esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
      7 features: [generators, class, class-static-methods-private]
      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  static * #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  static get method() {
     44    return this.#method;
     45  }
     46 };
     47 
     48 C.method(42, 'TC39',).next();
     49 
     50 assert.sameValue(callCount, 1, 'method invoked exactly once');
     51 
     52 reportCompare(0, 0);