Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-rest-getter.case
3 // - src/dstr-binding/default/try.template
4 /*---
5 description: Getter is called when obj is being deconstructed to a rest Object (try statement)
6 esid: sec-runtime-semantics-catchclauseevaluation
7 features: [object-rest, destructuring-binding]
8 flags: [generated]
9 includes: [propertyHelper.js]
10 info: |
11 Catch : catch ( CatchParameter ) Block
12
13 [...]
14 5. Let status be the result of performing BindingInitialization for
15 CatchParameter passing thrownValue and catchEnv as arguments.
16 [...]
17 ---*/
18 var count = 0;
19
20 var ranCatch = false;
21
22 try {
23 throw { get v() { count++; return 2; } };
24 } catch ({...x}) {
25 assert.sameValue(count, 1);
26
27 verifyProperty(x, "v", {
28 enumerable: true,
29 writable: true,
30 configurable: true,
31 value: 2
32 });
33 ranCatch = true;
34 }
35
36 assert(ranCatch, 'executed `catch` block');
37
38 reportCompare(0, 0);