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-sub-array.js
blob
f4359a62f3bfa0db7b1f4c6800cf52941cd6a329
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
})();