]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/compare-eq-object-to-object-or-other.js
JavaScriptCore-7600.1.4.15.12.tar.gz
[apple/javascriptcore.git] / tests / stress / compare-eq-object-to-object-or-other.js
CommitLineData
81345200
A
1function foo(a, b) {
2 return a == b;
3}
4
5noInline(foo);
6
7function test(a, b, expected) {
8 var result = foo(a, b);
9 if (result != expected)
10 throw new Error("Unexpected result: " + result);
11}
12
13for (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}