]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/weird-equality-folding-cases.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / weird-equality-folding-cases.js
CommitLineData
81345200
A
1function test(actualFunction, expected) {
2 var actual = actualFunction();
3 if (actual != expected)
4 throw new Error("bad in " + actualFunction + " result: " + actual);
5}
6
7noInline(test);
8
9for (var i = 0; i < 10000; ++i) {
10 test(function() { return "5" == 5; }, true);
11 test(function() { return ({valueOf:function(){return 42;}}) == 42; }, true);
12 test(function() { return ({valueOf:function(){return 42;}}) == ({valueOf:function(){return 42;}}) }, false);
13}