Debian Codegraph @

js/src/tests/test262/language/statements/try/dstr/ary-ptrn-elision-exhausted.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/ary-ptrn-elision-exhausted.case
3 // - src/dstr-binding/default/try.template
4 /*---
5 description: Elision accepts exhausted iterator (try statement)
6 esid: sec-runtime-semantics-catchclauseevaluation
7 features: [generators, 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 ArrayBindingPattern : [ Elision ]
20
21 1. Return the result of performing
22 IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
23 as the argument.
24
25 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
26
27 Elision : ,
28
29 1. If iteratorRecord.[[done]] is false, then
30 [...]
31 2. Return NormalCompletion(empty).
32
33 ---*/
34 var iter = function*() {}();
35 iter.next();
36
37 var ranCatch = false;
38
39 try {
40 throw iter;
41 } catch ([,]) {
42
43 ranCatch = true;
44 }
45
46 assert(ranCatch, 'executed `catch` block');
47
48 reportCompare(0, 0);