tor-browser

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

named-dflt-obj-ptrn-rest-getter.js (1213B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/dstr-binding/obj-ptrn-rest-getter.case
      4 // - src/dstr-binding/default/async-gen-func-named-expr-dflt.template
      5 /*---
      6 description: Getter is called when obj is being deconstructed to a rest Object (async generator named function expression (default parameter))
      7 esid: sec-asyncgenerator-definitions-evaluation
      8 features: [object-rest, async-iteration]
      9 flags: [generated, async]
     10 includes: [propertyHelper.js]
     11 info: |
     12    AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
     13        ( FormalParameters ) { AsyncGeneratorBody }
     14 
     15        [...]
     16        7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     17           AsyncGeneratorBody, funcEnv, strict).
     18        [...]
     19 
     20 ---*/
     21 var count = 0;
     22 
     23 
     24 var callCount = 0;
     25 var f;
     26 f = async function* h({...x} = { get v() { count++; return 2; } }) {
     27  assert.sameValue(count, 1);
     28 
     29  verifyProperty(x, "v", {
     30    enumerable: true,
     31    writable: true,
     32    configurable: true,
     33    value: 2
     34  });
     35  callCount = callCount + 1;
     36 };
     37 
     38 f().next().then(() => {
     39    assert.sameValue(callCount, 1, 'invoked exactly once');
     40 }).then($DONE, $DONE);