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