Sign in
webkit
/
WebKit
/
b0d7f9b249dd6483d6c7bc4f13c440c0842b7127
/
.
/
JSTests
/
microbenchmarks
/
int-or-other-neg-zero-then-get-by-val.js
blob: 1b69721aa72de1d653dc478a6593c01dd3a9cfb6 [
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
];
for
(
var
i
=
0
;
i
<
1000000
;
++
i
)
result
+=
foo
(-(
i
%
3
),
array
);
if
(
result
!=
42999999
)
throw
"Bad result: "
+
result
;