Update ReadMe.md
[qtwebkit.git] / JSTests / microbenchmarks / in-four-cases.js
blobd5c8846155e2010d597d7d7487822138a7f0db7a
1 function foo(a) {
2 var result = 0;
3 for (var i = 0; i < a.length; ++i) {
4 result <<= 1;
5 result ^= "foo" in a[i];
7 return result;
10 function bar() {
11 var array = [{foo:42}, {bar:42}, {fuzz:41, foo:43}, {baz: 47}];
12 var result = 0;
13 for (var i = 0; i < 1000000; ++i)
14 result += foo(array);
15 return result;
18 var result = bar();
19 if (result != 10000000)
20 throw "Bad result: " + result;