Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // The LHS of a for-loop is not bound to a particular scope until after the .next() method returns.
3 var obj = {};
5 // Test 1
6 function g() {
7 obj.x = 0;
8 yield 1;
9 }
10 var x = 2, n = 0;
11 with (obj) {
12 for (x of g()) // g().next() inserts a binding for x on obj
13 n++;
14 }
15 assertEq(x, 2);
16 assertEq(obj.x, 1);
17 assertEq(n, 1);
19 // Test 2
20 function h() {
21 delete obj.x;
22 yield 3;
23 }
24 n = 0;
25 with (obj) {
26 for (x of h()) // h().next() deletes the binding for x on obj
27 n++;
28 }
29 assertEq(x, 3);
30 assertEq("x" in obj, false);
31 assertEq(n, 1);