Debian Codegraph @

js/src/tests/test262/language/statements/try/dstr/obj-ptrn-prop-obj.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-prop-obj.case
3 // - src/dstr-binding/default/try.template
4 /*---
5 description: Object binding pattern with "nested" object binding pattern not using initializer (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.7 Runtime Semantics: KeyedBindingInitialization
18
19 [...]
20 3. If Initializer is present and v is undefined, then
21 [...]
22 4. Return the result of performing BindingInitialization for BindingPattern
23 passing v and environment as arguments.
24 ---*/
25
26 var ranCatch = false;
27
28 try {
29 throw { w: { x: undefined, z: 7 } };
30 } catch ({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
31 assert.sameValue(x, undefined);
32 assert.sameValue(y, undefined);
33 assert.sameValue(z, 7);
34
35 assert.throws(ReferenceError, function() {
36 w;
37 });
38 ranCatch = true;
39 }
40
41 assert(ranCatch, 'executed `catch` block');
42
43 reportCompare(0, 0);