// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
// - src/dstr-binding/default/try.template
/*---
description: Rest element containing an "empty" array pattern (try statement)
esid: sec-runtime-semantics-catchclauseevaluation
features: [generators, destructuring-binding]
flags: [generated]
info: |
    Catch : catch ( CatchParameter ) Block

    [...]
    5. Let status be the result of performing BindingInitialization for
       CatchParameter passing thrownValue and catchEnv as arguments.
    [...]

    13.3.3.6 Runtime Semantics: IteratorBindingInitialization

    BindingRestElement : ... BindingPattern

    1. Let A be ArrayCreate(0).
    [...]
    3. Repeat
       [...]
       b. If iteratorRecord.[[done]] is true, then
          i. Return the result of performing BindingInitialization of
             BindingPattern with A and environment as the arguments.
       [...]

    13.3.3.6 Runtime Semantics: IteratorBindingInitialization

    ArrayBindingPattern : [ ]

    1. Return NormalCompletion(empty).

---*/
var iterations = 0;
var iter = function*() {
  iterations += 1;
}();

var ranCatch = false;

try {
  throw iter;
} catch ([...[]]) {
  assert.sameValue(iterations, 1);
  ranCatch = true;
}

assert(ranCatch, 'executed `catch` block');
