summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onExceptionUnwind-15.js
blob: 0c6f46f23a01a25efeea054eeb433d2af2185bc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test that Ion->Baseline in-place debug mode bailout can recover the iterator
// from the snapshot in a for-of loop.

g = newGlobal();
g.parent = this;
g.eval("Debugger(parent).onExceptionUnwind=(function() {})");
function throwInNext() {
  yield 1;
  yield 2;
  yield 3;
  throw 42;
}

function f() {
  for (var o of new throwInNext);
}

var log = "";
try {
  f();
} catch (e) {
  log += e;
}

assertEq(log, "42");