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