tor-browser

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

async-gen-meth-dflt-obj-ptrn-list-err.js (1587B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/obj-ptrn-list-err.case
      3 // - src/dstr-binding/error/async-gen-method-dflt.template
      4 /*---
      5 description: Binding property list evaluation is interrupted by an abrupt completion (async generator method (default parameter))
      6 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
      7 features: [async-iteration]
      8 flags: [generated]
      9 info: |
     10    AsyncGeneratorMethod :
     11        async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
     12            { AsyncGeneratorBody }
     13 
     14    1. Let propKey be the result of evaluating PropertyName.
     15    2. ReturnIfAbrupt(propKey).
     16    3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
     17       Otherwise let strict be false.
     18    4. Let scope be the running execution context's LexicalEnvironment.
     19    5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
     20       AsyncGeneratorBody, scope, strict).
     21    [...]
     22 
     23    13.3.3.5 Runtime Semantics: BindingInitialization
     24 
     25    BindingPropertyList : BindingPropertyList , BindingProperty
     26 
     27    1. Let status be the result of performing BindingInitialization for
     28       BindingPropertyList using value and environment as arguments.
     29    2. ReturnIfAbrupt(status).
     30 ---*/
     31 var initCount = 0;
     32 function thrower() {
     33  throw new Test262Error();
     34 }
     35 
     36 
     37 var obj = {
     38  async *method({ a, b = thrower(), c = ++initCount } = {}) {
     39    
     40  }
     41 };
     42 
     43 assert.throws(Test262Error, function() {
     44  obj.method();
     45 });
     46 
     47 assert.sameValue(initCount, 0);
     48 
     49 reportCompare(0, 0);