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 // Test createThisScripted(), without a singleton.
2 function Foo(a) {
3 this.str = "foo";
4 }
6 function Bar(a) {
7 this.str = "bar";
8 }
10 function f() {
11 var x;
12 for (var i = 0; i < 400; i++) {
13 if (i % 2 == 0)
14 x = Foo;
15 else
16 x = Bar;
18 var y = new x(5);
20 if (i % 2 == 0)
21 assertEq(y.str, "foo");
22 else
23 assertEq(y.str, "bar");
24 }
25 }
27 f();