repo.or.cz
/
qtwebkit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Update ReadMe.md
[qtwebkit.git]
/
JSTests
/
microbenchmarks
/
in-one-case-true.js
blob
6535ac8a75ae7b700f71569e6c221a5384341ed5
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];
6
}
7
return result;
8
}
9
10
function bar() {
11
var array = [{foo:42}, {foo:42}];
12
var result = 0;
13
for (var i = 0; i < 1000000; ++i)
14
result += foo(array);
15
return result;
16
}
17
18
var result = bar();
19
if (result != 3000000)
20
throw "Bad result: " + result;
21