Sign in
webkit
/
WebKit
/
6b7c45f751131450b1675ef5b4b89fb3a0e35aba
/
.
/
JSTests
/
microbenchmarks
/
int-or-other-abs-zero-then-get-by-val.js
blob: 817ec205cca4d6ee4b58b394a21321e6c55a146b [
file
] [
log
] [
blame
]
var
p
=
{
f
:
true
};
function
foo
(
b
,
d
)
{
var
c
;
if
(
p
.
f
)
c
=
b
;
return
d
[
Math
.
abs
(
c
)];
}
var
result
=
0
;
var
array
=
[
42
,
43
,
44
];
for
(
var
i
=
0
;
i
<
1000000
;
++
i
)
result
+=
foo
(-(
i
%
3
),
array
);
if
(
result
!=
42999999
)
throw
"Bad result: "
+
result
;