Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
3 // - src/dstr-binding/error/try.template
4 /*---
5 description: Destructuring initializer is an unresolvable reference (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 BindingElement : BindingPattern Initializeropt
20
21 [...]
22 3. If Initializer is present and v is undefined, then
23 a. Let defaultValue be the result of evaluating Initializer.
24 b. Let v be GetValue(defaultValue).
25 c. ReturnIfAbrupt(v).
26
27 6.2.3.1 GetValue (V)
28
29 1. ReturnIfAbrupt(V).
30 2. If Type(V) is not Reference, return V.
31 3. Let base be GetBase(V).
32 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
33 ---*/
34
35 assert.throws(ReferenceError, function() {
36 try {
37 throw {};
38 } catch ({ x: y = unresolvableReference }) {}
39 });
40
41 reportCompare(0, 0);