Sign in
webkit
/
WebKit
/
6ddf72b170615ecec95a6e91c205227cc12d556b
/
.
/
JSTests
/
microbenchmarks
/
for-in-object-with-own-named.js
blob: 45f4e0f46002ea880424a884e22c40ac238afe5a [
file
] [
log
] [
blame
]
function
sum
(
o
)
{
let sum
=
0
;
for
(
let p in o
)
sum
+=
o
[
p
];
return
sum
;
}
function
opaqueSet
(
o
)
{
o
.
z
=
3
;
}
let object
=
{
x
:
1
,
y
:
2
};
opaqueSet
(
object
);
for
(
let i
=
0
;
i
<
1e5
;
++
i
)
{
if
(
sum
(
object
)
!==
6
)
throw
new
Error
(
"bad sum"
);
}