summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/directEval.js
blob: e9ba89d1292c57053247c9d55401ab54c81bbc13 (plain)
1
2
3
4
5
6
7
8
9
10

// test scope iteration when throwing from within an eval.
function testEvalThrow(x, y) {
  x = 5;
  for (var i in [1,2,3])
    eval("x += 5; if (i == 2) throw 0");
  assertEq(x, 10);
}
for (var i = 0; i < 5; i++)
  try { testEvalThrow.call({}, 3); } catch (e) { assertEq(e, 0); }