repo.or.cz
/
chromium-blink-merge.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Merge Chromium + Blink git repositories
[chromium-blink-merge.git]
/
third_party
/
WebKit
/
LayoutTests
/
fast
/
js
/
regress
/
script-tests
/
int-or-other-mod-then-get-by-val.js
blob
b5b1d402514f2c53a7325608a3999405a31c7060
1
var p = {f:true};
2
3
function foo(a, b, d) {
4
var c;
5
if (p.f)
6
c = b;
7
return d[a % c];
8
}
9
10
var result = 0;
11
var array = [42, 43];
12
for (var i = 0; i < 300000; ++i)
13
result += foo(i % 3, (i % 2) + 1, array);
14
15
if (result != 12650000)
16
throw "Bad result: " + result;
17