tor-browser

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

params-trailing-comma-multiple.js (1748B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/function-forms/params-trailing-comma-multiple.case
      3 // - src/function-forms/default/arrow-function.template
      4 /*---
      5 description: A trailing comma should not increase the respective length, using multiple parameters (arrow function expression)
      6 esid: sec-arrow-function-definitions-runtime-semantics-evaluation
      7 flags: [generated]
      8 info: |
      9    ArrowFunction : ArrowParameters => ConciseBody
     10 
     11    [...]
     12    4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).
     13    [...]
     14 
     15    9.2.1 [[Call]] ( thisArgument, argumentsList)
     16 
     17    [...]
     18    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     19    [...]
     20 
     21    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     22 
     23    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     24    [...]
     25 
     26    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     27 
     28    [...]
     29    23. Let iteratorRecord be Record {[[iterator]]:
     30        CreateListIterator(argumentsList), [[done]]: false}.
     31    24. If hasDuplicates is true, then
     32        [...]
     33    25. Else,
     34        b. Let formalStatus be IteratorBindingInitialization for formals with
     35           iteratorRecord and env as arguments.
     36    [...]
     37 
     38    Trailing comma in the parameters list
     39 
     40    14.1 Function Definitions
     41 
     42    FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
     43 ---*/
     44 
     45 var callCount = 0;
     46 // Stores a reference `ref` for case evaluation
     47 var ref;
     48 ref = (a, b,) => {
     49  assert.sameValue(a, 42);
     50  assert.sameValue(b, 39);
     51  callCount = callCount + 1;
     52 };
     53 
     54 ref(42, 39, 1);
     55 assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
     56 
     57 assert.sameValue(ref.length, 2, 'length is properly set');
     58 
     59 reportCompare(0, 0);