1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
function f() { var probeParam, probeBlock; let x = 'outside'; try { throw []; } catch ([_ = probeParam = function() { return x; }]) { probeBlock = function() { return x; }; let x = 'inside'; } assertEq(probeBlock(), 'inside'); assertEq(probeParam(), 'outside'); } f(); if (typeof reportCompare === 'function') reportCompare(true, true);