tor-browser

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

async-meth-dflt-params-trailing-comma.js (1123B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/dflt-params-trailing-comma.case
      4 // - src/function-forms/default/async-meth.template
      5 /*---
      6 description: A trailing comma should not increase the respective length, using default parameters (async method)
      7 esid: sec-async-function-definitions
      8 features: [async-functions]
      9 flags: [generated, async]
     10 info: |
     11    14.6 Async Function Definitions
     12 
     13    AsyncMethod :
     14     async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
     15 
     16 
     17    Trailing comma in the parameters list
     18 
     19    14.1 Function Definitions
     20 
     21    FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
     22 ---*/
     23 
     24 
     25 var callCount = 0;
     26 var __obj = {
     27  async method(a, b = 39,) {
     28    assert.sameValue(a, 42);
     29    assert.sameValue(b, 39);
     30    callCount = callCount + 1;
     31  }
     32 };
     33 
     34 // Stores a reference `ref` for case evaluation
     35 var ref = __obj.method;
     36 
     37 ref(42, undefined, 1).then(() => {
     38    assert.sameValue(callCount, 1, 'async method invoked exactly once');
     39 }).then($DONE, $DONE);
     40 
     41 assert.sameValue(ref.length, 1, 'length is properly set');