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
/
simple-poly-call.js
blob
1fdfef5c47bc8f60a5ad06e8d802471dd1a62548
1
(function() {
2
function foo(x) { return 1; }
3
function bar(x) { return x; }
4
5
var f = foo;
6
var g = bar;
7
8
var result = 0;
9
var n = 100000;
10
for (var i = 0; i < n; ++i) {
11
result += f(42);
12
13
var tmp = f;
14
f = g;
15
g = tmp;
16
}
17
18
if (result != n / 2 * 42 + n / 2 * 1)
19
throw "Error: bad result: " + result;
20
})();