scope-catch-block-lex-open.js (653B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-runtime-semantics-catchclauseevaluation 5 description: Creation of new lexical environment for `catch` block 6 info: | 7 [...] 8 8. Let B be the result of evaluating Block. 9 [...] 10 features: [let] 11 ---*/ 12 13 var probeParam, probeBlock; 14 let x = 'outside'; 15 16 try { 17 throw []; 18 } catch ([_ = probeParam = function() { return x; }]) { 19 probeBlock = function() { return x; }; 20 let x = 'inside'; 21 } 22 23 assert.sameValue(probeParam(), 'outside'); 24 assert.sameValue(probeBlock(), 'inside'); 25 26 reportCompare(0, 0);