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
/
object-int-and-array.js
blob
3d3ab3e65a6d58f8c41d7c54d3c5147b8897c02b
1
(function() {
2
var result = 0;
3
var m = 100;
4
var n = 100000;
5
var array = [];
6
for (var i = 0; i < 100; ++i)
7
array.push(12);
8
for (var i = 0; i < m; ++i) {
9
var value = 0;
10
var o = {valueOf: function() { return 42; }};
11
value += o;
12
var result = 0;
13
for (var j = 0; j < n; ++j)
14
result += array[value];
15
}
16
if (result != n * 12)
17
throw "Error: bad result: " + result;
18
})();