obj-ptrn-empty.js (991B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/obj-ptrn-empty.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: No property access occurs for an "empty" 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 Runtime Semantics: BindingInitialization 18 19 ObjectBindingPattern : { } 20 21 1. Return NormalCompletion(empty). 22 ---*/ 23 var accessCount = 0; 24 var obj = Object.defineProperty({}, 'attr', { 25 get: function() { 26 accessCount += 1; 27 } 28 }); 29 30 var ranCatch = false; 31 32 try { 33 throw obj; 34 } catch ({}) { 35 assert.sameValue(accessCount, 0); 36 ranCatch = true; 37 } 38 39 assert(ranCatch, 'executed `catch` block'); 40 41 reportCompare(0, 0);