4 <script src=
"../resources/runner.js"></script>
6 var div
= document
.createElement("div");
7 for (var i
= 0; i
< 1000; i
++) {
9 var value
= "value_" + i
;
10 div
.dataset
[key
] = value
;
12 function assertEquals(a
, b
) {
13 if (a
!== b
) console
.log("assertion failed: not equal", a
, b
);
16 for (var key
in div
.dataset
) {
17 var ref_key
= "key_" + i
;
18 var ref_value
= "value_" + i
;
19 assertEquals(key
, ref_key
);
20 assertEquals(div
.dataset
[key
], ref_value
);
24 PerfTestRunner
.measureRunsPerSecond({
25 description
: "This benchmark covers enumerator of named properties",
27 for (var key
in div
.dataset
);