tor-browser

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

named-dflt-obj-ptrn-prop-id.js (1238B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/dstr-binding/obj-ptrn-prop-id.case
      4 // - src/dstr-binding/default/async-gen-func-named-expr-dflt.template
      5 /*---
      6 description: Binding as specified via property name and identifier (async generator named function expression (default parameter))
      7 esid: sec-asyncgenerator-definitions-evaluation
      8 features: [async-iteration]
      9 flags: [generated, async]
     10 info: |
     11    AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
     12        ( FormalParameters ) { AsyncGeneratorBody }
     13 
     14        [...]
     15        7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     16           AsyncGeneratorBody, funcEnv, strict).
     17        [...]
     18 
     19 
     20    13.3.3.7 Runtime Semantics: KeyedBindingInitialization
     21 
     22    SingleNameBinding : BindingIdentifier Initializeropt
     23 
     24    [...]
     25    8. Return InitializeReferencedBinding(lhs, v).
     26 ---*/
     27 
     28 
     29 var callCount = 0;
     30 var f;
     31 f = async function* h({ x: y } = { x: 23 }) {
     32  assert.sameValue(y, 23);
     33  assert.throws(ReferenceError, function() {
     34    x;
     35  });
     36  callCount = callCount + 1;
     37 };
     38 
     39 f().next().then(() => {
     40    assert.sameValue(callCount, 1, 'invoked exactly once');
     41 }).then($DONE, $DONE);