tor-browser

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

named-dflt-ary-ptrn-rest-init-obj.js (1312B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/dstr-binding/ary-ptrn-rest-init-obj.case
      4 // - src/dstr-binding/default/async-gen-func-named-expr-dflt.template
      5 /*---
      6 description: Rest element (nested object pattern) does not support initializer (async generator named function expression (default parameter))
      7 esid: sec-asyncgenerator-definitions-evaluation
      8 features: [async-iteration]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
     15        ( FormalParameters ) { AsyncGeneratorBody }
     16 
     17        [...]
     18        7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     19           AsyncGeneratorBody, funcEnv, strict).
     20        [...]
     21 
     22 
     23    13.3.3 Destructuring Binding Patterns
     24    ArrayBindingPattern[Yield] :
     25        [ Elisionopt BindingRestElement[?Yield]opt ]
     26        [ BindingElementList[?Yield] ]
     27        [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
     28 ---*/
     29 $DONOTEVALUATE();
     30 
     31 
     32 var callCount = 0;
     33 var f;
     34 f = async function* h([...{ x } = []] = []) {
     35  
     36  callCount = callCount + 1;
     37 };
     38 
     39 f().next().then(() => {
     40    assert.sameValue(callCount, 1, 'invoked exactly once');
     41 }).then($DONE, $DONE);