blob: 41b1e3d0ef4777687cd2cf8cbf911fbc1a68f7d3 (
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
26
27
28
29
30
31
32
|
var finalizerRun = false;
var caught = false;
function foo(arr) {
finalizerRun = true;
return not_defined;
}
function gen() {
try {
yield 1;
} finally {
foo();
}
}
function test() {
var i_have_locals;
for (i in gen()) {
"this won't work"();
}
}
try {
test();
} catch(e) {
caught = true;
assertEq(''+e, "ReferenceError: not_defined is not defined");
}
assertEq(finalizerRun, true);
assertEq(caught, true);
|