Sign in
webkit
/
WebKit
/
919aeb989a73073e2f1d75e53d7d882b3cc61ca8
/
.
/
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"
);
}