scope-catch-block-lex-close.js (569B)
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: Removal of 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 probe, x; 14 15 try { 16 throw null; 17 } catch (_) { 18 let x = 'inside'; 19 probe = function() { return x; }; 20 } 21 x = 'outside'; 22 23 assert.sameValue(x, 'outside'); 24 assert.sameValue(probe(), 'inside'); 25 26 reportCompare(0, 0);