]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/weird-equality-folding-cases.js
1 function test(actualFunction
, expected
) {
2 var actual
= actualFunction();
3 if (actual
!= expected
)
4 throw new Error("bad in " + actualFunction
+ " result: " + actual
);
9 for (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);