]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/compare-eq-object-to-object-or-other.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / compare-eq-object-to-object-or-other.js
1 function foo(a, b) {
2 return a == b;
3 }
4
5 noInline(foo);
6
7 function test(a, b, expected) {
8 var result = foo(a, b);
9 if (result != expected)
10 throw new Error("Unexpected result: " + result);
11 }
12
13 for (var i = 0; i < 100000; ++i) {
14 var o = {f:42};
15 var p = {g:43};
16 test(o, o, true);
17 test(o, p, false);
18 test(p, o, false);
19 test(p, p, true);
20 test(o, null, false);
21 test(p, null, false);
22 test(o, void 0, false);
23 test(p, void 0, false);
24 }