| // This file was procedurally generated from the following sources: |
| // - src/dstr-binding/ary-init-iter-get-err.case |
| // - src/dstr-binding/error/async-gen-func-expr-dflt.template |
| /*--- |
| description: Abrupt completion returned by GetIterator (async generator function expression (default parameter)) |
| esid: sec-asyncgenerator-definitions-evaluation |
| features: [Symbol.iterator, async-iteration] |
| flags: [generated] |
| info: | |
| AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { |
| AsyncGeneratorBody } |
| |
| [...] |
| 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, |
| AsyncGeneratorBody, scope, strict). |
| [...] |
| |
| 13.3.3.5 Runtime Semantics: BindingInitialization |
| |
| BindingPattern : ArrayBindingPattern |
| |
| 1. Let iterator be GetIterator(value). |
| 2. ReturnIfAbrupt(iterator). |
| |
| ---*/ |
| var iter = {}; |
| iter[Symbol.iterator] = function() { |
| throw new Test262Error(); |
| }; |
| |
| |
| var f = async function*([x] = iter) { |
| |
| }; |
| |
| assert.throws(Test262Error, function() { |
| f(); |
| }); |