Sign in
webkit
/
WebKit
/
fd5c89692160ad7a4478776d3a7e8f4df224d2ad
/
.
/
JSTests
/
microbenchmarks
/
int-or-other-neg-then-get-by-val.js
blob: c606d3e8435edd43490394271369b78e33c9206e [
file
] [
log
] [
blame
]
var
p
=
{
f
:
true
};
function
foo
(
b
,
d
)
{
var
c
;
if
(
p
.
f
)
c
=
b
;
return
d
[-
c
];
}
var
result
=
0
;
var
array
=
[
42
,
43
,
44
,
45
];
for
(
var
i
=
0
;
i
<
500000
;
++
i
)
result
+=
foo
(-((
i
%
3
)
+
1
),
array
);
if
(
result
!=
21999999
)
throw
"Bad result: "
+
result
;