Debian Codegraph @

js/src/tests/test262/language/statements/try/dstr/ary-ptrn-rest-obj-id.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/ary-ptrn-rest-obj-id.case
3 // - src/dstr-binding/default/try.template
4 /*---
5 description: Rest element containing an object binding pattern (try statement)
6 esid: sec-runtime-semantics-catchclauseevaluation
7 features: [destructuring-binding]
8 flags: [generated]
9 info: |
10 Catch : catch ( CatchParameter ) Block
11
12 [...]
13 5. Let status be the result of performing BindingInitialization for
14 CatchParameter passing thrownValue and catchEnv as arguments.
15 [...]
16
17 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
18
19 BindingRestElement : ... BindingPattern
20
21 1. Let A be ArrayCreate(0).
22 [...]
23 3. Repeat
24 [...]
25 b. If iteratorRecord.[[done]] is true, then
26 i. Return the result of performing BindingInitialization of
27 BindingPattern with A and environment as the arguments.
28 [...]
29 ---*/
30
31 var ranCatch = false;
32
33 try {
34 throw [1, 2, 3];
35 } catch ([...{ length }]) {
36 assert.sameValue(length, 3);
37 ranCatch = true;
38 }
39
40 assert(ranCatch, 'executed `catch` block');
41
42 reportCompare(0, 0);