scope-catch-param-lex-open.js (638B)
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` parameter 6 ---*/ 7 8 var probeBefore = function() { return x; }; 9 var probeTry, probeParam; 10 var x = 'outside'; 11 12 try { 13 probeTry = function() { return x; }; 14 15 throw ['inside']; 16 } catch ([x, _ = probeParam = function() { return x; }]) {} 17 18 assert.sameValue(probeBefore(), 'outside'); 19 assert.sameValue(probeTry(), 'outside'); 20 assert.sameValue(probeParam(), 'inside'); 21 22 reportCompare(0, 0);