tor-browser

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

dflt-params-ref-later.js (1438B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/function-forms/dflt-params-ref-later.case
      3 // - src/function-forms/error/async-gen-func-decl.template
      4 /*---
      5 description: Referencing a parameter that occurs later in the ParameterList (async generator function declaration)
      6 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
      7 features: [default-parameters, async-iteration]
      8 flags: [generated]
      9 info: |
     10    AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
     11        ( FormalParameters ) { AsyncGeneratorBody }
     12 
     13        [...]
     14        3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
     15            scope, strict).
     16        [...]
     17 
     18 
     19    14.1.19 Runtime Semantics: IteratorBindingInitialization
     20 
     21    FormalsList : FormalsList , FormalParameter
     22 
     23    1. Let status be the result of performing IteratorBindingInitialization for
     24       FormalsList using iteratorRecord and environment as the arguments.
     25    2. ReturnIfAbrupt(status).
     26    3. Return the result of performing IteratorBindingInitialization for
     27       FormalParameter using iteratorRecord and environment as the arguments.
     28 
     29 ---*/
     30 var x = 0;
     31 
     32 
     33 var callCount = 0;
     34 async function* f(x = y, y) {
     35  
     36  callCount = callCount + 1;
     37 }
     38 
     39 assert.throws(ReferenceError, function() {
     40  f();
     41 });
     42 
     43 assert.sameValue(callCount, 0, 'generator function body not evaluated');
     44 
     45 reportCompare(0, 0);