tor-browser

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

dflt-ary-ptrn-elem-id-iter-val-err.js (1706B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
      3 // - src/dstr-binding/error/async-gen-func-expr-dflt.template
      4 /*---
      5 description: Error forwarding when IteratorValue returns an abrupt completion (async generator function expression (default parameter))
      6 esid: sec-asyncgenerator-definitions-evaluation
      7 features: [Symbol.iterator, 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    13.3.3.6 Runtime Semantics: IteratorBindingInitialization
     19 
     20    SingleNameBinding : BindingIdentifier Initializeropt
     21 
     22    [...]
     23    4. If iteratorRecord.[[done]] is false, then
     24       a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
     25       b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
     26       c. ReturnIfAbrupt(next).
     27       d. If next is false, set iteratorRecord.[[done]] to true.
     28       e. Else,
     29          i. Let v be IteratorValue(next).
     30          ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
     31              true.
     32          iii. ReturnIfAbrupt(v).
     33 
     34 ---*/
     35 var poisonedValue = Object.defineProperty({}, 'value', {
     36  get: function() {
     37    throw new Test262Error();
     38  }
     39 });
     40 var g = {};
     41 g[Symbol.iterator] = function() {
     42  return {
     43    next: function() {
     44      return poisonedValue;
     45    }
     46  };
     47 };
     48 
     49 
     50 var f = async function*([x] = g) {
     51  
     52 };
     53 
     54 assert.throws(Test262Error, function() {
     55  f();
     56 });
     57 
     58 reportCompare(0, 0);