tor-browser

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

dflt-params-ref-self.js (1406B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/function-forms/dflt-params-ref-self.case
      3 // - src/function-forms/error/async-gen-func-expr.template
      4 /*---
      5 description: Referencing a parameter from within its own initializer (async generator function expression)
      6 esid: sec-asyncgenerator-definitions-evaluation
      7 features: [default-parameters, async-iteration]
      8 flags: [generated]
      9 info: |
     10    AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
     11        AsyncGeneratorBody }
     12 
     13        [...]
     14        3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     15           AsyncGeneratorBody, 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 var f;
     35 f = async function*(x = x) {
     36  
     37  callCount = callCount + 1;
     38 };
     39 
     40 assert.throws(ReferenceError, function() {
     41  f();
     42 });
     43 assert.sameValue(callCount, 0, 'generator function body not evaluated');
     44 
     45 reportCompare(0, 0);