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 | |
michael@0 | 2 | // Test setting return value; |
michael@0 | 3 | |
michael@0 | 4 | function bail() { bailout(); } |
michael@0 | 5 | function bail2() { bailout(); return 2; } |
michael@0 | 6 | |
michael@0 | 7 | // Test 1: Test setting/getting return value in ionmonkey |
michael@0 | 8 | function test() { |
michael@0 | 9 | return evalcx("1;"); |
michael@0 | 10 | } |
michael@0 | 11 | assertEq(test(), 1) |
michael@0 | 12 | |
michael@0 | 13 | // Test 3: Test ion -> baseline |
michael@0 | 14 | function test2() { |
michael@0 | 15 | return evaluate("1; bail2();"); |
michael@0 | 16 | } |
michael@0 | 17 | assertEq(test2(), 2) |
michael@0 | 18 | |
michael@0 | 19 | // Test 3: Test ion -> baseline |
michael@0 | 20 | function test3() { |
michael@0 | 21 | return evaluate("1; bail2(); 3"); |
michael@0 | 22 | } |
michael@0 | 23 | assertEq(test3(), 3) |
michael@0 | 24 | |
michael@0 | 25 | // Test4: Test baseline -> ion entering (very fragile, since iterations need to be precise, before it gets tested) |
michael@0 | 26 | function test4() { |
michael@0 | 27 | return evaluate("1; for(var i=0; i<1097; i++) { 3; };"); |
michael@0 | 28 | } |
michael@0 | 29 | assertEq(test4(), 3) |