onExceptionUnwind-15.js (439B)
1 // Test that Ion->Baseline in-place debug mode bailout can recover the iterator 2 // from the snapshot in a for-of loop. 3 4 g = newGlobal({newCompartment: true}); 5 g.parent = this; 6 g.eval("Debugger(parent).onExceptionUnwind=(function() {})"); 7 function* throwInNext() { 8 yield 1; 9 yield 2; 10 yield 3; 11 throw 42; 12 } 13 14 function f() { 15 for (var o of throwInNext()); 16 } 17 18 var log = ""; 19 try { 20 f(); 21 } catch (e) { 22 log += e; 23 } 24 25 assertEq(log, "42");