summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/LexicalEnvironment/catch-body.js
blob: 43b9d2bfe39dbe437670b14c3062a47ce4373268 (plain)
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);