tor-browser

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

obj-ptrn-rest-val-obj.js (1300B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/dstr-binding/obj-ptrn-rest-val-obj.case
      4 // - src/dstr-binding/default/async-gen-func-decl.template
      5 /*---
      6 description: Rest object contains just unextracted data (async generator function declaration)
      7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
      8 features: [object-rest, async-iteration]
      9 flags: [generated, async]
     10 includes: [propertyHelper.js]
     11 info: |
     12    AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
     13        ( FormalParameters ) { AsyncGeneratorBody }
     14 
     15        [...]
     16        3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
     17            scope, strict).
     18        [...]
     19 
     20 ---*/
     21 
     22 
     23 var callCount = 0;
     24 async function* f({a, b, ...rest}) {
     25  assert.sameValue(rest.a, undefined);
     26  assert.sameValue(rest.b, undefined);
     27 
     28  verifyProperty(rest, "x", {
     29    enumerable: true,
     30    writable: true,
     31    configurable: true,
     32    value: 1
     33  });
     34 
     35  verifyProperty(rest, "y", {
     36    enumerable: true,
     37    writable: true,
     38    configurable: true,
     39    value: 2
     40  });
     41  callCount = callCount + 1;
     42 };
     43 f({x: 1, y: 2, a: 5, b: 3}).next().then(() => {
     44    assert.sameValue(callCount, 1, 'invoked exactly once');
     45 }).then($DONE, $DONE);