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.
michael@0 | 1 | function testFuncStmt1() { |
michael@0 | 2 | var g = 3; |
michael@0 | 3 | function f(b) { |
michael@0 | 4 | if (b) { |
michael@0 | 5 | function g() { return 42 } |
michael@0 | 6 | assertEq(g(), 42); |
michael@0 | 7 | } |
michael@0 | 8 | } |
michael@0 | 9 | f(true); |
michael@0 | 10 | } |
michael@0 | 11 | testFuncStmt1(); |
michael@0 | 12 | |
michael@0 | 13 | function testFuncStmt2() { |
michael@0 | 14 | var g = 3; |
michael@0 | 15 | (function(b) { |
michael@0 | 16 | if (b) { |
michael@0 | 17 | function g() { return 42 } |
michael@0 | 18 | function f() { assertEq(g(), 42); } |
michael@0 | 19 | f(); |
michael@0 | 20 | } |
michael@0 | 21 | })(true); |
michael@0 | 22 | } |
michael@0 | 23 | testFuncStmt2(); |
michael@0 | 24 | |
michael@0 | 25 | function testEval1() { |
michael@0 | 26 | var g = 3; |
michael@0 | 27 | function f() { |
michael@0 | 28 | eval("var g = 42"); |
michael@0 | 29 | assertEq(g, 42); |
michael@0 | 30 | } |
michael@0 | 31 | f(); |
michael@0 | 32 | } |
michael@0 | 33 | testEval1(); |
michael@0 | 34 | |
michael@0 | 35 | function testEval2() { |
michael@0 | 36 | var g = 3; |
michael@0 | 37 | (function() { |
michael@0 | 38 | eval("var g = 42"); |
michael@0 | 39 | function f() { |
michael@0 | 40 | assertEq(g, 42); |
michael@0 | 41 | } |
michael@0 | 42 | f(); |
michael@0 | 43 | })(); |
michael@0 | 44 | } |
michael@0 | 45 | testEval2(); |
michael@0 | 46 | |
michael@0 | 47 | function testWith1() { |
michael@0 | 48 | var g = 3; |
michael@0 | 49 | function f() { |
michael@0 | 50 | with ({g:42}) { |
michael@0 | 51 | assertEq(g, 42); |
michael@0 | 52 | } |
michael@0 | 53 | } |
michael@0 | 54 | f(); |
michael@0 | 55 | } |
michael@0 | 56 | testWith1(); |
michael@0 | 57 | |
michael@0 | 58 | function testWith2() { |
michael@0 | 59 | var g = 3; |
michael@0 | 60 | with ({g:42}) { |
michael@0 | 61 | function f() { |
michael@0 | 62 | assertEq(g, 42); |
michael@0 | 63 | } |
michael@0 | 64 | } |
michael@0 | 65 | f(); |
michael@0 | 66 | } |
michael@0 | 67 | testWith2(); |