]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/inlined-constructor-this-liveness.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / inlined-constructor-this-liveness.js
CommitLineData
81345200
A
1function Foo(a, b) {
2 this.f = a.f;
3 this.g = b.f + 1;
4}
5
6function foo(a, b) {
7 return new Foo(a, b);
8}
9
10noInline(foo);
11
12for (var i = 0; i < 100000; ++i) {
13 var result = foo({f:1}, {f:2});
14 if (result.f != 1)
15 throw "Error: bad result.f: " + result.f;
16 if (result.g != 3)
17 throw "Error: bad result.g: " + result.g;
18}
19
20var result = foo({f:1}, {f:2.5});
21if (result.f != 1)
22 throw "Error: bad result.f: " + result.f;
23if (result.g != 3.5)
24 throw "Error: bad result.f: " + result.g;